}
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)
error: bunyanLogFactory('error'),
fatal: bunyanLogFactory('error')
}
+
+type LoggerTagsFn = (...tags: string[]) => { tags: string[] }
+function loggerTagsFactory (...defaultTags: string[]): LoggerTagsFn {
+ return (...tags: string[]) => {
+ return { tags: defaultTags.concat(tags) }
+ }
+}
+
// ---------------------------------------------------------------------------
export {
+ LoggerTagsFn,
+
buildLogger,
timestampFormatter,
labelFormatter,
consoleLoggerFormat,
jsonLoggerFormat,
logger,
+ loggerTagsFactory,
bunyanLogger
}