diff options
author | Chocobozzz <me@florianbigard.com> | 2021-01-26 09:54:32 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-01-26 09:54:32 +0100 |
commit | 1e743faafeed89af13ee9dd3d62c1ceb696779cd (patch) | |
tree | 059b37295b8507ad9c858f19ed113cec44908a4b /server/helpers/logger.ts | |
parent | 448487a60216dcfe1ae29fa581cb31c726f1441b (diff) | |
download | PeerTube-1e743faafeed89af13ee9dd3d62c1ceb696779cd.tar.gz PeerTube-1e743faafeed89af13ee9dd3d62c1ceb696779cd.tar.zst PeerTube-1e743faafeed89af13ee9dd3d62c1ceb696779cd.zip |
Disable sql prettifier by default
It adds too much lines, leading to difficulties when reading dev logs
Diffstat (limited to 'server/helpers/logger.ts')
-rw-r--r-- | server/helpers/logger.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/helpers/logger.ts b/server/helpers/logger.ts index f1808849e..0548dfd5b 100644 --- a/server/helpers/logger.ts +++ b/server/helpers/logger.ts | |||
@@ -40,14 +40,17 @@ function getLoggerReplacer () { | |||
40 | } | 40 | } |
41 | 41 | ||
42 | const consoleLoggerFormat = winston.format.printf(info => { | 42 | const consoleLoggerFormat = winston.format.printf(info => { |
43 | const obj = omit(info, 'label', 'timestamp', 'level', 'message', 'sql') | 43 | const toOmit = [ 'label', 'timestamp', 'level', 'message' ] |
44 | if (CONFIG.LOG.PRETTIFY_SQL) toOmit.push('sql') | ||
45 | |||
46 | const obj = omit(info, ...toOmit) | ||
44 | 47 | ||
45 | let additionalInfos = JSON.stringify(obj, getLoggerReplacer(), 2) | 48 | let additionalInfos = JSON.stringify(obj, getLoggerReplacer(), 2) |
46 | 49 | ||
47 | if (additionalInfos === undefined || additionalInfos === '{}') additionalInfos = '' | 50 | if (additionalInfos === undefined || additionalInfos === '{}') additionalInfos = '' |
48 | else additionalInfos = ' ' + additionalInfos | 51 | else additionalInfos = ' ' + additionalInfos |
49 | 52 | ||
50 | if (info.sql) { | 53 | if (CONFIG.LOG.PRETTIFY_SQL && info.sql) { |
51 | additionalInfos += '\n' + sqlFormat(info.sql, { | 54 | additionalInfos += '\n' + sqlFormat(info.sql, { |
52 | language: 'sql', | 55 | language: 'sql', |
53 | ident: ' ' | 56 | ident: ' ' |