mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
parent
833a24f088
commit
afb9a4f336
@ -16,7 +16,7 @@ export interface BaseHandlerOptions {
|
||||
formatter?: FormatterFunction;
|
||||
}
|
||||
|
||||
export class BaseHandler {
|
||||
export abstract class BaseHandler {
|
||||
#levelName: LevelName;
|
||||
#level: LogLevel;
|
||||
formatter: FormatterFunction;
|
||||
@ -59,7 +59,7 @@ export class BaseHandler {
|
||||
return this.formatter(logRecord);
|
||||
}
|
||||
|
||||
log(_msg: string) {}
|
||||
abstract log(msg: string): void;
|
||||
setup() {}
|
||||
destroy() {}
|
||||
|
||||
|
@ -52,7 +52,7 @@ export class ConsoleHandler extends BaseHandler {
|
||||
return msg;
|
||||
}
|
||||
|
||||
override log(msg: string) {
|
||||
log(msg: string) {
|
||||
console.log(msg);
|
||||
}
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ export class FileHandler extends BaseHandler {
|
||||
}
|
||||
}
|
||||
|
||||
override log(msg: string) {
|
||||
log(msg: string) {
|
||||
const bytes = this[encoderSymbol].encode(msg + "\n");
|
||||
if (bytes.byteLength > this[bufSymbol].byteLength - this[pointerSymbol]) {
|
||||
this.flush();
|
||||
|
Loading…
Reference in New Issue
Block a user