From b77e1247583a1c23bb5f5cf6fff425dabc66b572 Mon Sep 17 00:00:00 2001 From: T31M Date: Sat, 25 Jan 2020 13:54:38 +0100 Subject: [PATCH] fix: message could also be non string --- javascript_typescript/logging.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript_typescript/logging.js b/javascript_typescript/logging.js index 75ffb92..107d335 100644 --- a/javascript_typescript/logging.js +++ b/javascript_typescript/logging.js @@ -12,7 +12,7 @@ const maxFunctionLogLength = 60; const myFormat = printf(({ timestamp, loc, level, message }) => { const start = process.hrtime(); if (loc) { - return `${timestamp} ${level}: ${message.padEnd(105 - level.length)} ${loc.padEnd( + return `${timestamp} ${level}: ${message.toString().padEnd(105 - level.length)} ${loc.padEnd( 60 )} log: ${(process.hrtime(start)[1] / 1000000).toFixed(2)}ms`; }