Refactoring of logger
This commit is contained in:
parent
80aa45372a
commit
05baa89508
2 changed files with 14 additions and 9 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue