diff options
author | Chocobozzz <me@florianbigard.com> | 2020-01-31 16:56:52 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-02-03 08:31:02 +0100 |
commit | a15871560f80e07386c1dabb8370cd2664ecfd1f (patch) | |
tree | 44440e140c9e43b0d7f97ade777a76e649e0553d /server/helpers/logger.ts | |
parent | a22046d166805222ca76060e471b6cb3d419a32d (diff) | |
download | PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.gz PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.zst PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.zip |
Move to eslintcontain
Diffstat (limited to 'server/helpers/logger.ts')
-rw-r--r-- | server/helpers/logger.ts | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/server/helpers/logger.ts b/server/helpers/logger.ts index fd2988ad0..b8ae28b3f 100644 --- a/server/helpers/logger.ts +++ b/server/helpers/logger.ts | |||
@@ -27,7 +27,7 @@ function getLoggerReplacer () { | |||
27 | if (value instanceof Error) { | 27 | if (value instanceof Error) { |
28 | const error = {} | 28 | const error = {} |
29 | 29 | ||
30 | Object.getOwnPropertyNames(value).forEach(key => error[ key ] = value[ key ]) | 30 | Object.getOwnPropertyNames(value).forEach(key => { error[key] = value[key] }) |
31 | 31 | ||
32 | return error | 32 | return error |
33 | } | 33 | } |
@@ -98,19 +98,20 @@ function bunyanLogFactory (level: string) { | |||
98 | let args: any[] = [] | 98 | let args: any[] = [] |
99 | args.concat(arguments) | 99 | args.concat(arguments) |
100 | 100 | ||
101 | if (arguments[ 0 ] instanceof Error) { | 101 | if (arguments[0] instanceof Error) { |
102 | meta = arguments[ 0 ].toString() | 102 | meta = arguments[0].toString() |
103 | args = Array.prototype.slice.call(arguments, 1) | 103 | args = Array.prototype.slice.call(arguments, 1) |
104 | args.push(meta) | 104 | args.push(meta) |
105 | } else if (typeof (args[ 0 ]) !== 'string') { | 105 | } else if (typeof (args[0]) !== 'string') { |
106 | meta = arguments[ 0 ] | 106 | meta = arguments[0] |
107 | args = Array.prototype.slice.call(arguments, 1) | 107 | args = Array.prototype.slice.call(arguments, 1) |
108 | args.push(meta) | 108 | args.push(meta) |
109 | } | 109 | } |
110 | 110 | ||
111 | logger[ level ].apply(logger, args) | 111 | logger[level].apply(logger, args) |
112 | } | 112 | } |
113 | } | 113 | } |
114 | |||
114 | const bunyanLogger = { | 115 | const bunyanLogger = { |
115 | trace: bunyanLogFactory('debug'), | 116 | trace: bunyanLogFactory('debug'), |
116 | debug: bunyanLogFactory('debug'), | 117 | debug: bunyanLogFactory('debug'), |