mirror of
https://github.com/denoland/deno.git
synced 2024-12-18 05:14:21 -05:00
27 lines
737 B
TypeScript
27 lines
737 B
TypeScript
|
import { BaseHandler } from '../handler.ts';
|
||
|
import { LogLevel } from '../levels.ts';
|
||
|
|
||
|
export class ConsoleHandler extends BaseHandler {
|
||
|
_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;
|
||
|
}
|
||
|
}
|
||
|
}
|