diff options
Diffstat (limited to 'packages/taler-util/src/logging.ts')
-rw-r--r-- | packages/taler-util/src/logging.ts | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/packages/taler-util/src/logging.ts b/packages/taler-util/src/logging.ts index 663bc59c8..17bb184f7 100644 --- a/packages/taler-util/src/logging.ts +++ b/packages/taler-util/src/logging.ts @@ -37,7 +37,6 @@ const byTagLogLevel: Record<string, LogLevel> = {}; let nativeLogging: boolean = false; - // from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/toString Error.prototype.toString = function () { if ( @@ -51,14 +50,13 @@ Error.prototype.toString = function () { let msg = this.message; msg = msg === undefined ? "" : `${msg}`; - let cause = "" + let cause = ""; if ("cause" in this) { - cause = `\n Caused by: ${this.cause}` + cause = `\n Caused by: ${this.cause}`; } return `${name}: ${msg}${cause}`; }; - export function getGlobalLogLevel(): string { return globalLogLevel; } @@ -148,7 +146,7 @@ function writeNodeLog( * and uses the corresponding console.* method to log in the browser. */ export class Logger { - constructor(private tag: string) { } + constructor(private tag: string) {} shouldLogTrace(): boolean { const level = byTagLogLevel[this.tag] ?? globalLogLevel; |