mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
refactor(server): auto print full stack on logger.error (#10161)
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
} from '@nestjs/testing';
|
||||
|
||||
import { AppModule, FunctionalityModules } from '../../app.module';
|
||||
import { Runtime } from '../../base';
|
||||
import { AFFiNELogger, Runtime } from '../../base';
|
||||
import { GqlModule } from '../../base/graphql';
|
||||
import { AuthGuard, AuthModule } from '../../core/auth';
|
||||
import { ModelsModule } from '../../models';
|
||||
@@ -95,16 +95,15 @@ export async function createTestingModule(
|
||||
await module.close();
|
||||
};
|
||||
|
||||
const logger = new AFFiNELogger();
|
||||
// we got a lot smoking tests try to break nestjs
|
||||
// can't tolerate the noisy logs
|
||||
logger.setLogLevels([TEST_LOG_LEVEL]);
|
||||
module.useLogger(logger);
|
||||
|
||||
if (autoInitialize) {
|
||||
// we got a lot smoking tests try to break nestjs
|
||||
// can't tolerate the noisy logs
|
||||
// @ts-expect-error private
|
||||
module.applyLogger({
|
||||
logger: [TEST_LOG_LEVEL],
|
||||
});
|
||||
await testingModule.initTestingDB();
|
||||
await testingModule.init();
|
||||
}
|
||||
|
||||
return testingModule;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user