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:
parent
448487a602
commit
1e743faafe
5 changed files with 11 additions and 4 deletions
|
@ -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: ' '
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue