Skip to content

Commit

Permalink
chore: adjust log level (#6913)
Browse files Browse the repository at this point in the history
  • Loading branch information
darkskygit committed May 14, 2024
1 parent b8333de commit 8881286
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
4 changes: 3 additions & 1 deletion packages/backend/server/src/core/doc/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ export class DocHistoryManager {
description: 'How many times the snapshot history created',
})
.add(1);
this.logger.log(`History created for ${id} in workspace ${workspaceId}.`);
this.logger.debug(
`History created for ${id} in workspace ${workspaceId}.`
);
}
}

Expand Down
6 changes: 4 additions & 2 deletions packages/backend/server/src/core/quota/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ export class QuotaManagementService {
const total = usedSize + recvSize;
// only skip total storage check if workspace has unlimited feature
if (total > quota && !unlimited) {
this.logger.log(`storage size limit exceeded: ${total} > ${quota}`);
this.logger.warn(`storage size limit exceeded: ${total} > ${quota}`);
return true;
} else if (recvSize > blobLimit) {
this.logger.log(`blob size limit exceeded: ${recvSize} > ${blobLimit}`);
this.logger.warn(
`blob size limit exceeded: ${recvSize} > ${blobLimit}`
);
return true;
} else {
return false;
Expand Down
6 changes: 3 additions & 3 deletions packages/backend/server/src/fundamentals/cache/interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class CacheInterceptor implements NestInterceptor {
if (preventKey) {
const key = await this.getCacheKey(ctx, preventKey);
if (key) {
this.logger.debug(`cache ${key} staled`);
this.logger.verbose(`cache ${key} staled`);
await this.cache.delete(key);
}

Expand All @@ -60,10 +60,10 @@ export class CacheInterceptor implements NestInterceptor {
const cachedData = await this.cache.get(cacheKey);

if (cachedData) {
this.logger.debug(`cache ${cacheKey} hit`);
this.logger.verbose(`cache ${cacheKey} hit`);
return of(cachedData);
} else {
this.logger.debug(`cache ${cacheKey} miss`);
this.logger.verbose(`cache ${cacheKey} miss`);
return next.handle().pipe(
mergeMap(async result => {
await this.cache.set(cacheKey, result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function registerCopilotProvider<
);
}
const instance = new provider(providerConfig as C);
logger.log(
logger.debug(
`Copilot provider ${type} registered, capabilities: ${provider.capabilities.join(', ')}`
);

Expand Down
2 changes: 1 addition & 1 deletion packages/backend/server/src/plugins/redis/mutex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class RedisMutexLocker implements ILocker {

async lock(owner: string, key: string): Promise<Lock> {
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(
new Command('EVAL', [lockScript, '1', lockKey, owner])
Expand Down

0 comments on commit 8881286

Please sign in to comment.