seen.add(value)
}
+ if (value instanceof Set) {
+ return Array.from(value)
+ }
+
+ if (value instanceof Map) {
+ return Array.from(value.entries())
+ }
+
if (value instanceof Error) {
const error = {}
}
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
}