fix: message could also be non string

This commit is contained in:
2020-01-25 13:54:38 +01:00
parent b7efe3f08c
commit b77e124758

View File

@ -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`;
}