Skip to content
Snippets Groups Projects
Unverified Commit 09aba4cf authored by Kagami Sascha Rosylight's avatar Kagami Sascha Rosylight Committed by GitHub
Browse files

chore(backend/logger): log data for every level if exists (#12863)

parent 5498ec57
No related branches found
No related tags found
No related merge requests found
......@@ -71,8 +71,11 @@ export default class Logger {
let log = `${l} ${worker}\t[${contexts.join(' ')}]\t${m}`;
if (envOption.withLogTime) log = chalk.gray(time) + ' ' + log;
console.log(important ? chalk.bold(log) : log);
if (level === 'error' && data) console.log(data);
const args: unknown[] = [important ? chalk.bold(log) : log];
if (data != null) {
args.push(data);
}
console.log(...args);
}
@bindThis
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment