Files
Comfyui-LayerForge/js/ImageCache.js
Dariusz L 7fe34e940e 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.
2025-06-26 01:33:05 +02:00

31 lines
662 B
JavaScript

import {createModuleLogger} from "./LoggerUtils.js";
// Inicjalizacja loggera dla modułu ImageCache
const log = createModuleLogger('ImageCache');
export class ImageCache {
constructor() {
this.cache = new Map();
}
set(key, imageData) {
log.info("Caching image data for key:", key);
this.cache.set(key, imageData);
}
get(key) {
const data = this.cache.get(key);
log.debug("Retrieved cached data for key:", key, !!data);
return data;
}
has(key) {
return this.cache.has(key);
}
clear() {
log.info("Clearing image cache");
this.cache.clear();
}
}