From 8684d390c17bde2ed220d783fd82326d1d04b583 Mon Sep 17 00:00:00 2001 From: Yossi Eynav Date: Sun, 18 Feb 2024 09:13:00 +0200 Subject: [PATCH] fix --- server/api/lib/log.js | 13 ++++--------- server/bin/serve | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/server/api/lib/log.js b/server/api/lib/log.js index e37c22c9..4419fe07 100644 --- a/server/api/lib/log.js +++ b/server/api/lib/log.js @@ -43,22 +43,17 @@ const logger = winston.createLogger({ ] }); - - module.exports = { debug: (...args) => { - logger.debug({message: args.join(',')}); + logger.debug(...args); }, info: (...args) => { - logger.info({message: args.join(",")}); + logger.info(...args); }, error: (...args) => { - logger.error({message: args.join(",")}); - }, - errorW: (message, payload) => { - logger.error({message, ...payload}); + logger.error(...args); }, warn: (...args) => { - logger.warn({message: args.join(",")}); + logger.warn(...args); } }; diff --git a/server/bin/serve b/server/bin/serve index 3cf34c9d..410f6213 100644 --- a/server/bin/serve +++ b/server/bin/serve @@ -10,7 +10,7 @@ const logger = require('../api/lib/log') process.on('uncaughtException', function(err) { - logger.errorW('uncaught exception', { err }) + logger.error('uncaught exception', { err }) throw err; });