From 128c9f7c3911bf442b2bf7fc8fb7c3823342c6a0 Mon Sep 17 00:00:00 2001 From: Ersun Warncke Date: Tue, 29 Jan 2019 12:00:14 -0400 Subject: [PATCH] lower case prod check, bump version --- libraries/logger/logging-manager.coffee | 5 +++-- libraries/logger/package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/logger/logging-manager.coffee b/libraries/logger/logging-manager.coffee index 509dbcc026..a7d4e6d27b 100644 --- a/libraries/logger/logging-manager.coffee +++ b/libraries/logger/logging-manager.coffee @@ -3,13 +3,14 @@ request = require('request') module.exports = Logger = initialize: (name) -> - @defaultLevel = process.env['LOG_LEVEL'] or if process.env["NODE_ENV"] == 'production' then "warn" else "debug" + isProduction = process.env['NODE_ENV']?.toLowerCase() == 'production' + @defaultLevel = process.env['LOG_LEVEL'] or if isProduction then "warn" else "debug" @loggerName = name @logger = bunyan.createLogger name: name serializers: bunyan.stdSerializers level: @defaultLevel - if process.env["NODE_ENV"] == 'production' + if isProduction # check for log level override on startup @.checkLogLevel() # re-check log level every minute diff --git a/libraries/logger/package.json b/libraries/logger/package.json index 69f5260d40..96d8d7dd8a 100644 --- a/libraries/logger/package.json +++ b/libraries/logger/package.json @@ -6,7 +6,7 @@ "type": "git", "url": "http://github.com/sharelatex/logger-sharelatex.git" }, - "version": "1.5.9", + "version": "1.6.0", "scripts": { "test": "mocha --require coffee-script/register test/**/*.coffee" },