1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Disable sql prettifier by default

It adds too much lines, leading to difficulties when reading dev logs
This commit is contained in:
Chocobozzz 2021-01-26 09:54:32 +01:00
parent 448487a602
commit 1e743faafe
No known key found for this signature in database
GPG key ID: 583A612D890159BE
5 changed files with 11 additions and 4 deletions

View file

@ -40,14 +40,17 @@ function getLoggerReplacer () {
}
const consoleLoggerFormat = winston.format.printf(info => {
const obj = omit(info, 'label', 'timestamp', 'level', 'message', 'sql')
const toOmit = [ 'label', 'timestamp', 'level', 'message' ]
if (CONFIG.LOG.PRETTIFY_SQL) toOmit.push('sql')
const obj = omit(info, ...toOmit)
let additionalInfos = JSON.stringify(obj, getLoggerReplacer(), 2)
if (additionalInfos === undefined || additionalInfos === '{}') additionalInfos = ''
else additionalInfos = ' ' + additionalInfos
if (info.sql) {
if (CONFIG.LOG.PRETTIFY_SQL && info.sql) {
additionalInfos += '\n' + sqlFormat(info.sql, {
language: 'sql',
ident: ' '