From 22bf8eb86fc9c7873a3510876f5d3e330cd26766 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 17 Apr 2019 16:45:31 +0900 Subject: [PATCH] Disable sql log --- src/db/postgre.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/db/postgre.ts b/src/db/postgre.ts index 641a552c0..71836638f 100644 --- a/src/db/postgre.ts +++ b/src/db/postgre.ts @@ -76,8 +76,6 @@ class MyCustomLogger implements Logger { } export function initDb(justBorrow = false, sync = false, log = false) { - const enableLogging = log || !['production', 'test'].includes(process.env.NODE_ENV || ''); - try { const conn = getConnection(); return Promise.resolve(conn); @@ -92,8 +90,8 @@ export function initDb(justBorrow = false, sync = false, log = false) { database: config.db.db, synchronize: process.env.NODE_ENV === 'test' || sync, dropSchema: process.env.NODE_ENV === 'test' && !justBorrow, - logging: enableLogging, - logger: enableLogging ? new MyCustomLogger() : undefined, + logging: log, + logger: log ? new MyCustomLogger() : undefined, entities: [ Meta, Instance,