Merge pull request #832 from deivisonrpg/change-cache-logs-level

[Proposta] Alterar level dos logs do cache para verbose
This commit is contained in:
Davidson Gomes 2024-08-27 17:32:42 -03:00 committed by GitHub
commit 3b9761992a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -7,9 +7,9 @@ export class CacheService {
constructor(private readonly cache: ICache) { constructor(private readonly cache: ICache) {
if (cache) { if (cache) {
this.logger.info(`cacheservice created using cache engine: ${cache.constructor?.name}`); this.logger.verbose(`cacheservice created using cache engine: ${cache.constructor?.name}`);
} else { } else {
this.logger.info(`cacheservice disabled`); this.logger.verbose(`cacheservice disabled`);
} }
} }

View File

@ -5,7 +5,7 @@ import { Logger } from '@config/logger.config';
import { LocalCache } from './localcache'; import { LocalCache } from './localcache';
import { RedisCache } from './rediscache'; import { RedisCache } from './rediscache';
const logger = new Logger('Redis'); const logger = new Logger('CacheEngine');
export class CacheEngine { export class CacheEngine {
private engine: ICache; private engine: ICache;
@ -14,12 +14,14 @@ export class CacheEngine {
const cacheConf = configService.get<CacheConf>('CACHE'); const cacheConf = configService.get<CacheConf>('CACHE');
if (cacheConf?.REDIS?.ENABLED && cacheConf?.REDIS?.URI !== '') { if (cacheConf?.REDIS?.ENABLED && cacheConf?.REDIS?.URI !== '') {
logger.verbose(`RedisCache initialized for ${module}`);
this.engine = new RedisCache(configService, module); this.engine = new RedisCache(configService, module);
} else if (cacheConf?.LOCAL?.ENABLED) { } else if (cacheConf?.LOCAL?.ENABLED) {
logger.verbose(`LocalCache initialized for ${module}`);
this.engine = new LocalCache(configService, module); this.engine = new LocalCache(configService, module);
} }
logger.info(`RedisCache initialized for ${module}`);
} }
public getEngine() { public getEngine() {