| 41 | * @public |
| 42 | */ |
| 43 | export class Logger { |
| 44 | public static logLevel: LogLevel = LogLevel.Info; |
| 45 | public static log: ILogger = new ConsoleLogger(); |
| 46 | |
| 47 | private static _shouldLog(level: LogLevel): boolean { |
| 48 | return Logger.logLevel !== LogLevel.None && level >= Logger.logLevel; |
| 49 | } |
| 50 | |
| 51 | public static debug(category: string, msg: string, ...details: unknown[]): void { |
| 52 | if (Logger._shouldLog(LogLevel.Debug)) { |
| 53 | Logger.log.debug(category, msg, ...details); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | public static warning(category: string, msg: string, ...details: unknown[]): void { |
| 58 | if (Logger._shouldLog(LogLevel.Warning)) { |
| 59 | Logger.log.warning(category, msg, ...details); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | public static info(category: string, msg: string, ...details: unknown[]): void { |
| 64 | if (Logger._shouldLog(LogLevel.Info)) { |
| 65 | Logger.log.info(category, msg, ...details); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | public static error(category: string, msg: string, ...details: unknown[]): void { |
| 70 | if (Logger._shouldLog(LogLevel.Error)) { |
| 71 | Logger.log.error(category, msg, ...details); |
| 72 | } |
| 73 | } |
| 74 | } |
nothing calls this directly
no outgoing calls
no test coverage detected