X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Flogger.ts;h=5fe3646c55eaf6a23732c75430ba01278c586678;hb=a2f99b54dfdfe489e14714681189cb13c89f60a3;hp=4bd00e50345abb597bb94d778d14711071e0ea29;hpb=41fb13c330de629df2d23379209e79c7af0f2e9a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/logger.ts b/server/helpers/logger.ts index 4bd00e503..5fe3646c5 100644 --- a/server/helpers/logger.ts +++ b/server/helpers/logger.ts @@ -1,5 +1,5 @@ // 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' @@ -10,10 +10,6 @@ import { LOG_FILENAME } from '../initializers/constants' 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() @@ -123,10 +119,9 @@ function buildLogger (labelSuffix?: string) { } 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() @@ -143,6 +138,7 @@ function bunyanLogFactory (level: string) { } const bunyanLogger = { + level: () => { }, trace: bunyanLogFactory('debug'), debug: bunyanLogFactory('debug'), info: bunyanLogFactory('info'),