}
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)
if (CONFIG.LOG.PRETTIFY_SQL) {
additionalInfos += '\n' + sqlFormat(info.sql, {
language: 'sql',
- ident: ' '
+ indent: ' '
})
} else {
additionalInfos += ' - ' + info.sql
error: bunyanLogFactory('error'),
fatal: bunyanLogFactory('error')
}
+
+function loggerTagsFactory (...defaultTags: string[]) {
+ return (...tags: string[]) => {
+ return { tags: defaultTags.concat(tags) }
+ }
+}
+
// ---------------------------------------------------------------------------
export {
consoleLoggerFormat,
jsonLoggerFormat,
logger,
+ loggerTagsFactory,
bunyanLogger
}