mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
feature(@nestjs/core) add useLogger() to Nest context #926
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user