From fbb0833bf0d633dc32bdd114ce942dc64b4fd49b Mon Sep 17 00:00:00 2001 From: Antoine Date: Sun, 3 Mar 2019 10:21:20 +0100 Subject: [PATCH] fix: logging logLevel --- src/logging.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/logging.ts b/src/logging.ts index a790859..8b88206 100644 --- a/src/logging.ts +++ b/src/logging.ts @@ -14,11 +14,9 @@ export function logger(winstonInstance) { let logLevel: string; if (ctx.status >= 500) { logLevel = 'error'; - } - if (ctx.status >= 400) { + } else if (ctx.status >= 400) { logLevel = 'warn'; - } - if (ctx.status >= 100) { + } else if (ctx.status >= 100) { logLevel = 'info'; } @@ -41,4 +39,4 @@ export function logger(winstonInstance) { winstonInstance.log(logLevel, msg); }; -} \ No newline at end of file +}