Refactoring of logger

This commit is contained in:
syuilo
2019-02-03 01:24:59 +09:00
parent 80aa45372a
commit 05baa89508
2 changed files with 14 additions and 9 deletions

View File

@ -5,9 +5,14 @@ export default class Logger {
private domain: string;
private parentLogger: Logger;
constructor(domain: string, parentLogger?: Logger) {
constructor(domain: string) {
this.domain = domain;
this.parentLogger = parentLogger;
}
public createSubLogger(domain: string): Logger {
const logger = new Logger(domain);
logger.parentLogger = this;
return logger;
}
public log(level: string, message: string, important = false): void {