Skip to content

Commit

Permalink
Update logger.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Corantin committed Nov 22, 2023
1 parent 5c9258d commit 2f94b9a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/nextjs/services/logger.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
let currentWallet: string | undefined = undefined;

if (!("toJSON" in Error.prototype))
Object.defineProperty(Error.prototype, "toJSON", {
value: function () {
const alt = {};

Object.getOwnPropertyNames(this).forEach(key => {
// @ts-ignore
alt[key] = this[key];
}, this);

return alt;
},
configurable: true,
writable: true,
});

const logger = {
debug: (payload: any) => {
handleLog(payload, "debug");
Expand Down

0 comments on commit 2f94b9a

Please sign in to comment.