2018-12-24 10:28:01 -05:00
|
|
|
import { BaseHandler } from "../handler.ts";
|
|
|
|
import { LogLevel } from "../levels.ts";
|
2018-12-19 19:16:45 +01:00
|
|
|
|
|
|
|
export class ConsoleHandler extends BaseHandler {
|
2018-12-24 10:28:01 -05:00
|
|
|
_log(level, ...args) {
|
|
|
|
switch (level) {
|
|
|
|
case LogLevel.DEBUG:
|
|
|
|
console.log(...args);
|
|
|
|
return;
|
|
|
|
case LogLevel.INFO:
|
|
|
|
console.info(...args);
|
|
|
|
return;
|
|
|
|
case LogLevel.WARNING:
|
|
|
|
console.warn(...args);
|
|
|
|
return;
|
|
|
|
case LogLevel.ERROR:
|
|
|
|
console.error(...args);
|
|
|
|
return;
|
|
|
|
case LogLevel.CRITICAL:
|
|
|
|
console.error(...args);
|
|
|
|
return;
|
|
|
|
default:
|
|
|
|
return;
|
2018-12-19 19:16:45 +01:00
|
|
|
}
|
2018-12-24 10:28:01 -05:00
|
|
|
}
|
2018-12-19 19:16:45 +01:00
|
|
|
}
|