Refactor logger initialization to use createModuleLogger

Replaced manual logger setup in CanvasRenderer, ImageCache, Mask_tool, and db modules with the createModuleLogger utility for cleaner and more consistent logging initialization.
This commit is contained in:
Dariusz L
2025-06-26 01:33:05 +02:00
parent 7e539d37ab
commit 7fe34e940e
4 changed files with 11 additions and 43 deletions

View File

@@ -1,15 +1,7 @@
import {logger, LogLevel} from "./logger.js";
import {createModuleLogger} from "./LoggerUtils.js";
// Inicjalizacja loggera dla modułu Mask_tool
const log = {
debug: (...args) => logger.debug('Mask_tool', ...args),
info: (...args) => logger.info('Mask_tool', ...args),
warn: (...args) => logger.warn('Mask_tool', ...args),
error: (...args) => logger.error('Mask_tool', ...args)
};
// Konfiguracja loggera dla modułu Mask_tool
logger.setModuleLevel('Mask_tool', LogLevel.DEBUG);
const log = createModuleLogger('Mask_tool');
export class MaskTool {
constructor(canvasInstance) {
@@ -152,4 +144,4 @@ export class MaskTool {
this.maskCtx = this.maskCanvas.getContext('2d');
this.maskCtx.drawImage(oldMask, 0, 0);
}
}
}