mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-12-04 01:38:54 +09:00
Better sql log
This commit is contained in:
parent
c52aeb6618
commit
bfcda7cc02
@ -69,8 +69,10 @@ class MyCustomLogger implements Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public logQuery(query: string, parameters?: any[]) {
|
public logQuery(query: string, parameters?: any[]) {
|
||||||
|
if (program.verbose) {
|
||||||
sqlLogger.info(this.highlight(query));
|
sqlLogger.info(this.highlight(query));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public logQueryError(error: string, query: string, parameters?: any[]) {
|
public logQueryError(error: string, query: string, parameters?: any[]) {
|
||||||
sqlLogger.error(this.highlight(query));
|
sqlLogger.error(this.highlight(query));
|
||||||
@ -158,7 +160,7 @@ export function initDb(justBorrow = false, sync = false, forceRecreate = false)
|
|||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
const log = program.verbose;
|
const log = process.env.NODE_ENV != 'production';
|
||||||
|
|
||||||
return createConnection({
|
return createConnection({
|
||||||
type: 'postgres',
|
type: 'postgres',
|
||||||
|
Loading…
Reference in New Issue
Block a user