fix(logger): Replace direct console logging with unified logger interface for consistent formatting
This commit is contained in:
17
ts/logger.ts
17
ts/logger.ts
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
export class Logger {
|
||||
private currentBoxWidth: number | null = null;
|
||||
private static instance: Logger;
|
||||
|
||||
/**
|
||||
* Creates a new Logger instance
|
||||
@@ -12,6 +13,17 @@ export class Logger {
|
||||
this.currentBoxWidth = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the singleton logger instance
|
||||
* @returns The singleton logger instance
|
||||
*/
|
||||
public static getInstance(): Logger {
|
||||
if (!Logger.instance) {
|
||||
Logger.instance = new Logger();
|
||||
}
|
||||
return Logger.instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log a message
|
||||
* @param message Message to log
|
||||
@@ -129,4 +141,7 @@ export class Logger {
|
||||
public logDivider(width: number, character: string = '─'): void {
|
||||
console.log(character.repeat(width));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Export a singleton instance for easy use
|
||||
export const logger = Logger.getInstance();
|
Reference in New Issue
Block a user