@marcopeg/utils
Advanced tools
Comparing version 1.11.0 to 1.11.1
@@ -33,5 +33,6 @@ 'use strict'; | ||
var getLogLevel = function getLogLevel() { | ||
var envLogLevel = config.get('LOG_LEVEL', ''); | ||
var logLevel = envLogLevel.toUpperCase(); | ||
// computes the default value based on function param or LOG_LEVEL env variable | ||
var getLogLevel = function getLogLevel(defaultLogLevel) { | ||
var envLogLevel = config.get('LOG_LEVEL', 'dn'); | ||
var logLevel = String(envLogLevel === 'dn' ? defaultLogLevel : envLogLevel).toUpperCase(); | ||
var logLevelNum = parseInt(logLevel, 10); | ||
@@ -45,3 +46,3 @@ | ||
if (envLogLevel === 'development') return logLevels.INFO; | ||
return logLevels.ERROR; | ||
return logLevels.INFO; | ||
}; | ||
@@ -57,3 +58,3 @@ | ||
var init = function init(logLevel) { | ||
cache.logLevel = logLevel || getLogLevel(); | ||
cache.logLevel = getLogLevel(logLevel); | ||
Object.keys(logLevels).forEach(function (key) { | ||
@@ -60,0 +61,0 @@ cache[logLevels[key]] = cache.logLevel < logLevels[key]; |
{ | ||
"name": "@marcopeg/utils", | ||
"version": "1.11.0", | ||
"version": "1.11.1", | ||
"description": "Javascript utils for server and client projects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23431
500