feature(@nestjs/core) add useLogger() to Nest context #926

This commit is contained in:
Kamil Myśliwiec
2018-08-01 22:33:02 +02:00
parent 9f77d5f550
commit 946ed2e339
3 changed files with 14 additions and 2 deletions

View File

@@ -1,5 +1,7 @@
import {
INestApplicationContext,
Logger,
LoggerService,
OnModuleDestroy,
OnModuleInit,
} from '@nestjs/common';
@@ -64,6 +66,10 @@ export class NestApplicationContext extends ModuleRef
await this.callDestroyHook();
}
public useLogger(logger: LoggerService) {
Logger.overrideLogger(logger);
}
protected async callInitHook(): Promise<any> {
const modules = this.container.getModules();
await Promise.all(