From c96418806f49ef21dc17e6a9a9ee22a3d92fb445 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 641a552c09..71836638f1 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,