Skip to content

Commit

Permalink
fix: only use console.log output the log strings
Browse files Browse the repository at this point in the history
  • Loading branch information
TabSpace committed Jan 12, 2021
1 parent 49d2781 commit 97c9d87
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/mods/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,6 @@ export default abstract class Logger {
const icon = icons[String(spec.flag)] || icons[level];
const color = spec.color || colors[flag] || colors[level];

let method = String(level) as keyof Console;
if (typeof console[method] !== 'function') {
method = 'log';
}

let args = [];
args = para.slice(0);
args = args.map((item) => {
Expand Down Expand Up @@ -264,10 +259,7 @@ export default abstract class Logger {
this.transport(msg);
}
if (conf.print) {
if (method === 'debug') {
method = 'log';
}
console[method](...contentArgs);
console.log(...contentArgs);
}
}

Expand Down

0 comments on commit 97c9d87

Please sign in to comment.