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 ImageCache
const log = {
debug: (...args) => logger.debug('ImageCache', ...args),
info: (...args) => logger.info('ImageCache', ...args),
warn: (...args) => logger.warn('ImageCache', ...args),
error: (...args) => logger.error('ImageCache', ...args)
};
// Konfiguracja loggera dla modułu ImageCache
logger.setModuleLevel('ImageCache', LogLevel.DEBUG);
const log = createModuleLogger('ImageCache');
export class ImageCache {
constructor() {
@@ -35,4 +27,4 @@ export class ImageCache {
log.info("Clearing image cache");
this.cache.clear();
}
}
}