From: Chocobozzz Date: Mon, 11 Oct 2021 12:49:10 +0000 (+0200) Subject: Fix email logger typings X-Git-Tag: v4.0.0-rc.1~294 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=40a8c0a4c4f654ba720ece6219816ad9c4fb9f5e;p=github%2FChocobozzz%2FPeerTube.git Fix email logger typings --- diff --git a/server/helpers/logger.ts b/server/helpers/logger.ts index 4bd00e503..81b0dfaaa 100644 --- a/server/helpers/logger.ts +++ b/server/helpers/logger.ts @@ -123,10 +123,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 +142,7 @@ function bunyanLogFactory (level: string) { } const bunyanLogger = { + level: () => { }, trace: bunyanLogFactory('debug'), debug: bunyanLogFactory('debug'), info: bunyanLogFactory('info'), diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts index 6bb61484b..60284ea28 100644 --- a/server/lib/emailer.ts +++ b/server/lib/emailer.ts @@ -222,7 +222,7 @@ class Emailer { sendmail: true, newline: 'unix', path: CONFIG.SMTP.SENDMAIL, - logger: bunyanLogger as any + logger: bunyanLogger }) }