fix(logger): Replace direct console logging with unified logger interface for consistent formatting

This commit is contained in:
2025-03-26 22:28:38 +00:00
parent 03056d279d
commit f3de3f0618
9 changed files with 157 additions and 106 deletions

View File

@@ -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();