suppress messages from TypeORM migration and schema loading in production
This commit is contained in:
@@ -98,6 +98,8 @@ pg.types.setTypeParser(20, Number);
|
|||||||
export const dbLogger = new MisskeyLogger('db');
|
export const dbLogger = new MisskeyLogger('db');
|
||||||
|
|
||||||
const sqlLogger = dbLogger.createSubLogger('sql', 'gray');
|
const sqlLogger = dbLogger.createSubLogger('sql', 'gray');
|
||||||
|
const sqlMigrateLogger = sqlLogger.createSubLogger('migrate');
|
||||||
|
const sqlSchemaLogger = sqlLogger.createSubLogger('schema');
|
||||||
|
|
||||||
export type LoggerProps = {
|
export type LoggerProps = {
|
||||||
disableQueryTruncation?: boolean;
|
disableQueryTruncation?: boolean;
|
||||||
@@ -179,7 +181,7 @@ class MyCustomLogger implements Logger {
|
|||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public logSchemaBuild(message: string) {
|
public logSchemaBuild(message: string) {
|
||||||
sqlLogger.info(message);
|
sqlSchemaLogger.debug(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
@@ -198,7 +200,7 @@ class MyCustomLogger implements Logger {
|
|||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public logMigration(message: string) {
|
public logMigration(message: string) {
|
||||||
sqlLogger.info(message);
|
sqlMigrateLogger.debug(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user