All files / lib Logger.ts

66.66% Statements 4/6
0% Branches 0/3
66.66% Functions 2/3
60% Lines 3/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17    12x 45x               290x          
import { logLevelType } from "./Container";
 
export class Logger {
    constructor(private readonly ctx: string, private readonly logLevel: logLevelType) {
    }
 
    private logStr(message: string, ctx?: string) {
        return `[type-chef-di][${ctx || this.ctx}] ${message}`;
    }
 
    debug(msg: string, ctx?: string) {
        Iif (this.logLevel === "debug") {
            console.log(this.logStr(msg, ctx));
        }
    }
}