1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-01 08:18:45 +09:00

Better sql log

This commit is contained in:
syuilo 2020-03-29 14:08:19 +09:00
parent c52aeb6618
commit bfcda7cc02

View File

@ -69,7 +69,9 @@ class MyCustomLogger implements Logger {
}
public logQuery(query: string, parameters?: any[]) {
sqlLogger.info(this.highlight(query));
if (program.verbose) {
sqlLogger.info(this.highlight(query));
}
}
public logQueryError(error: string, query: string, parameters?: any[]) {
@ -158,7 +160,7 @@ export function initDb(justBorrow = false, sync = false, forceRecreate = false)
} catch (e) {}
}
const log = program.verbose;
const log = process.env.NODE_ENV != 'production';
return createConnection({
type: 'postgres',