From 805e12c792c7dd2d7ea4f21d75b1a5b674778873 Mon Sep 17 00:00:00 2001 From: Braun Patrik Date: Sun, 16 Jul 2017 20:49:39 +0200 Subject: [PATCH] reducing logging in production --- backend/Logger.ts | 2 +- backend/model/memory/UserManager.ts | 2 -- backend/server.ts | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/Logger.ts b/backend/Logger.ts index ac64ab90..c29546d1 100644 --- a/backend/Logger.ts +++ b/backend/Logger.ts @@ -10,7 +10,7 @@ declare module 'winston' { export const winstonSettings = { transports: [ new winston.transports.Console({ - level: 'silly', + level: process.env.NODE_ENV == "production" ? "info" : 'silly', handleExceptions: true, json: false, colorize: true, diff --git a/backend/model/memory/UserManager.ts b/backend/model/memory/UserManager.ts index f179e9d7..a25ed630 100644 --- a/backend/model/memory/UserManager.ts +++ b/backend/model/memory/UserManager.ts @@ -56,8 +56,6 @@ export class UserManager implements IUserManager { delete filter.password; const users = (await this.db.get("users")).slice(); let i = users.length; - console.log("filer", filter); - console.log(users); while (i--) { if (pass && !(PasswordHelper.comparePassword(pass, users[i].password))) { users.splice(i, 1); diff --git a/backend/server.ts b/backend/server.ts index 41ba91c5..771ae1ac 100644 --- a/backend/server.ts +++ b/backend/server.ts @@ -25,7 +25,7 @@ export class Server { private server: any; constructor() { - if (process.env.DEBUG) { + if (!(process.env.NODE_ENV == "production")) { Logger.debug(LOG_TAG, "Running in DEBUG mode"); } this.init();