X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Flogger.ts;h=a112fd30006b1d2f7706c5946d386261d6b23b61;hb=0ae3ebb03edf8b6a6d74666f006d7373e393e40d;hp=746b2e0a6d0a05f3eec6b563ee7a669c94e70a2e;hpb=1896bca09e088b0da9d5e845407ecebae330618c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/logger.ts b/server/helpers/logger.ts index 746b2e0a6..a112fd300 100644 --- a/server/helpers/logger.ts +++ b/server/helpers/logger.ts @@ -48,7 +48,7 @@ function getLoggerReplacer () { } const consoleLoggerFormat = winston.format.printf(info => { - const toOmit = [ 'label', 'timestamp', 'level', 'message', 'sql' ] + const toOmit = [ 'label', 'timestamp', 'level', 'message', 'sql', 'tags' ] const obj = omit(info, ...toOmit) @@ -61,7 +61,7 @@ const consoleLoggerFormat = winston.format.printf(info => { if (CONFIG.LOG.PRETTIFY_SQL) { additionalInfos += '\n' + sqlFormat(info.sql, { language: 'sql', - ident: ' ' + indent: ' ' }) } else { additionalInfos += ' - ' + info.sql @@ -150,6 +150,13 @@ const bunyanLogger = { error: bunyanLogFactory('error'), fatal: bunyanLogFactory('error') } + +function loggerTagsFactory (...defaultTags: string[]) { + return (...tags: string[]) => { + return { tags: defaultTags.concat(tags) } + } +} + // --------------------------------------------------------------------------- export { @@ -159,5 +166,6 @@ export { consoleLoggerFormat, jsonLoggerFormat, logger, + loggerTagsFactory, bunyanLogger }