lower case prod check, bump version

This commit is contained in:
Ersun Warncke 2019-01-29 12:00:14 -04:00
parent 8764c7378b
commit 128c9f7c39
2 changed files with 4 additions and 3 deletions

View file

@ -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

View file

@ -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"
},