logs correctly parse error.

This commit is contained in:
Miroslav Šedivý
2021-09-12 17:00:11 +02:00
parent b2f92a86bb
commit 94a62e4846
2 changed files with 16 additions and 2 deletions

View File

@ -11,6 +11,12 @@ export class Logger {
let t = ''
const args = []
for (const name in fields) {
if (fields[name] instanceof Error) {
t += ' %c%s="%s"%c'
args.push('color:#d84949;', name, (fields[name] as Error).message, '')
continue
}
if (typeof fields[name] === 'string' || fields[name] instanceof String) {
t += ' %c%s=%c"%s"'
} else {