From 9cbcedea0a930485d8bd35f5c102f6bea618abe9 Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Sun, 6 Sep 2020 12:17:05 +0200 Subject: [PATCH] Adding forcable logs --- gulpfile.ts | 2 +- package.json | 2 +- src/backend/Logger.ts | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gulpfile.ts b/gulpfile.ts index c2e88c63..6e2300b1 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -10,7 +10,7 @@ import * as child_process from 'child_process'; // @ts-ignore import * as jeditor from 'gulp-json-editor'; import {XLIFF} from 'xlf-google-translate'; -import {Config, PrivateConfigClass} from './src/common/config/private/Config'; +import {PrivateConfigClass} from './src/common/config/private/Config'; import {ConfigClassBuilder} from 'typeconfig/src/decorators/builders/ConfigClassBuilder'; const execPr = util.promisify(child_process.exec); diff --git a/package.json b/package.json index 8d25c7b9..d8a2e598 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "sqlite3": "4.1.1", "ts-exif-parser": "0.2.1", "ts-node-iptc": "1.0.11", - "typeconfig": "2.0.9", + "typeconfig": "2.0.10", "typeorm": "0.2.21", "winston": "2.4.4" }, diff --git a/src/backend/Logger.ts b/src/backend/Logger.ts index 74d14506..405d785f 100644 --- a/src/backend/Logger.ts +++ b/src/backend/Logger.ts @@ -2,10 +2,12 @@ import * as winston from 'winston'; import {Config} from '../common/config/private/Config'; import {ServerConfig} from '../common/config/private/PrivateConfig'; +const forcedDebug = process.env.NODE_ENV === 'debug'; + export const winstonSettings = { transports: [ new winston.transports.Console({ - level: ServerConfig.LogLevel[Config.Server.Log.level], + level: forcedDebug === true ? ServerConfig.LogLevel.silly : ServerConfig.LogLevel[Config.Server.Log.level], handleExceptions: true, json: false, colorize: true,