reconsider logging levels

This commit is contained in:
rubikscraft
2022-04-18 16:43:27 +02:00
parent 5ca8516560
commit 4612a9ea6f
29 changed files with 124 additions and 359 deletions

View File

@@ -47,14 +47,14 @@ export class MainAuthGuard extends AuthGuard(['jwt', 'guest']) {
// These are the permissions required to access the route
const permissions = this.extractPermissions(context);
if (HasFailed(permissions)) {
this.logger.warn('Route Permissions: ' + permissions.getReason());
this.logger.error('Fetching route permission failed: ' + permissions.getReason());
throw new InternalServerErrorException();
}
// These are the permissions the user has
const userPermissions = await this.usersService.getPermissions(user.id);
if (HasFailed(userPermissions)) {
this.logger.warn('User Permissions: ' + userPermissions.getReason());
this.logger.warn('Fetching user permissions failed: ' + userPermissions.getReason());
throw new InternalServerErrorException();
}

View File

@@ -20,7 +20,7 @@ export class DemoManagerModule implements OnModuleInit, OnModuleDestroy {
async onModuleInit() {
if (this.hostConfigService.isDemo()) {
this.logger.log('Demo mode enabled');
this.logger.warn('Demo mode enabled, images are ephimeral');
await this.setupDemoMode();
}
}

View File

@@ -14,7 +14,7 @@ export class DemoManagerService {
public async setupRoles() {
this.logger.warn(
'Modifying roles for demo mode, this will not be reverted automatically',
'Modifying roles for demo mode, this will have to be reverted manually',
);
// Could be done manually, but this makes settup up a demo instance quicker
this.rolesService.addPermissions('guest', [Permission.ImageUpload]);
@@ -25,7 +25,7 @@ export class DemoManagerService {
}
private async executeAsync() {
this.logger.debug('Executing demo cleanup');
this.logger.verbose('Executing demo cleanup');
await this.imagesService.deleteAll(true);
}
}