chore: adjust log level (#6913)

This commit is contained in:
darkskygit
2024-05-14 09:32:28 +00:00
parent b8333de119
commit 8881286025
5 changed files with 12 additions and 8 deletions

View File

@@ -102,7 +102,9 @@ export class DocHistoryManager {
description: 'How many times the snapshot history created', description: 'How many times the snapshot history created',
}) })
.add(1); .add(1);
this.logger.log(`History created for ${id} in workspace ${workspaceId}.`); this.logger.debug(
`History created for ${id} in workspace ${workspaceId}.`
);
} }
} }

View File

@@ -72,10 +72,12 @@ export class QuotaManagementService {
const total = usedSize + recvSize; const total = usedSize + recvSize;
// only skip total storage check if workspace has unlimited feature // only skip total storage check if workspace has unlimited feature
if (total > quota && !unlimited) { if (total > quota && !unlimited) {
this.logger.log(`storage size limit exceeded: ${total} > ${quota}`); this.logger.warn(`storage size limit exceeded: ${total} > ${quota}`);
return true; return true;
} else if (recvSize > blobLimit) { } else if (recvSize > blobLimit) {
this.logger.log(`blob size limit exceeded: ${recvSize} > ${blobLimit}`); this.logger.warn(
`blob size limit exceeded: ${recvSize} > ${blobLimit}`
);
return true; return true;
} else { } else {
return false; return false;

View File

@@ -42,7 +42,7 @@ export class CacheInterceptor implements NestInterceptor {
if (preventKey) { if (preventKey) {
const key = await this.getCacheKey(ctx, preventKey); const key = await this.getCacheKey(ctx, preventKey);
if (key) { if (key) {
this.logger.debug(`cache ${key} staled`); this.logger.verbose(`cache ${key} staled`);
await this.cache.delete(key); await this.cache.delete(key);
} }
@@ -60,10 +60,10 @@ export class CacheInterceptor implements NestInterceptor {
const cachedData = await this.cache.get(cacheKey); const cachedData = await this.cache.get(cacheKey);
if (cachedData) { if (cachedData) {
this.logger.debug(`cache ${cacheKey} hit`); this.logger.verbose(`cache ${cacheKey} hit`);
return of(cachedData); return of(cachedData);
} else { } else {
this.logger.debug(`cache ${cacheKey} miss`); this.logger.verbose(`cache ${cacheKey} miss`);
return next.handle().pipe( return next.handle().pipe(
mergeMap(async result => { mergeMap(async result => {
await this.cache.set(cacheKey, result); await this.cache.set(cacheKey, result);

View File

@@ -52,7 +52,7 @@ export function registerCopilotProvider<
); );
} }
const instance = new provider(providerConfig as C); const instance = new provider(providerConfig as C);
logger.log( logger.debug(
`Copilot provider ${type} registered, capabilities: ${provider.capabilities.join(', ')}` `Copilot provider ${type} registered, capabilities: ${provider.capabilities.join(', ')}`
); );

View File

@@ -42,7 +42,7 @@ export class RedisMutexLocker implements ILocker {
async lock(owner: string, key: string): Promise<Lock> { async lock(owner: string, key: string): Promise<Lock> {
const lockKey = `MutexLock:${key}`; const lockKey = `MutexLock:${key}`;
this.logger.debug(`Client ${owner} is trying to lock resource ${key}`); this.logger.verbose(`Client ${owner} is trying to lock resource ${key}`);
const success = await this.redis.sendCommand( const success = await this.redis.sendCommand(
new Command('EVAL', [lockScript, '1', lockKey, owner]) new Command('EVAL', [lockScript, '1', lockKey, owner])