// Thanks http://tostring.it/2014/06/23/advanced-logging-with-nodejs/
-import { mkdirpSync, stat } from 'fs-extra'
+import { stat } from 'fs-extra'
import { omit } from 'lodash'
import { join } from 'path'
import { format as sqlFormat } from 'sql-formatter'
const label = CONFIG.WEBSERVER.HOSTNAME + ':' + CONFIG.WEBSERVER.PORT
-// Create the directory if it does not exist
-// FIXME: use async
-mkdirpSync(CONFIG.STORAGE.LOG_DIR)
-
function getLoggerReplacer () {
const seen = new WeakSet()
}
function bunyanLogFactory (level: string) {
- return function () {
+ return function (...params: any[]) {
let meta = null
- let args: any[] = []
- args.concat(arguments)
+ let args = [].concat(params)
if (arguments[0] instanceof Error) {
meta = arguments[0].toString()
}
const bunyanLogger = {
+ level: () => { },
trace: bunyanLogFactory('debug'),
debug: bunyanLogFactory('debug'),
info: bunyanLogFactory('info'),