Stringify objects in the details field of logger config
This commit is contained in:
1 parent
120296763b
commit
3fc79d47ba
1 file changed
+4
@@ -7,6 +7,10 @@ class Logger {
|
|||||||
if (message instanceof Object) {
|
if (message instanceof Object) {
|
||||||
message = JSON.stringify(message, null, 2);
|
message = JSON.stringify(message, null, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (details instanceof Object) {
|
||||||
|
details = JSON.stringify(details, null, 2);
|
||||||
|
}
|
||||||
let msg = `${timestamp} ${level}:`;
|
let msg = `${timestamp} ${level}:`;
|
||||||
service && (msg += ` [${service}]`);
|
service && (msg += ` [${service}]`);
|
||||||
method && (msg += `(${method})`);
|
method && (msg += `(${method})`);
|
||||||
|
|||||||
Reference in new issue
Block a user