From 672a5466698d83dede51feb31c0666cd7e6072ce Mon Sep 17 00:00:00 2001 From: eternal-flame-AD Date: Sun, 17 Nov 2024 06:01:25 -0600 Subject: [PATCH] don't log metrics for postgres in testing Signed-off-by: eternal-flame-AD --- packages/backend/src/postgres.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/postgres.ts b/packages/backend/src/postgres.ts index 6fce6a6faa..15707d3050 100644 --- a/packages/backend/src/postgres.ts +++ b/packages/backend/src/postgres.ts @@ -342,7 +342,8 @@ export function createPostgresDataSource(config: Config, isMain = false) { }, } : false, logging: log ? 'all' : ['query'], - logger: (isMain || log) ? new MyCustomLogger(!log) : undefined, + logger: process.env.NODE_ENV === 'test' ? undefined : + (isMain || log) ? new MyCustomLogger(!log) : undefined, maxQueryExecutionTime: 500, entities: entities, migrations: ['../../migration/*.js'],