strapi-utils
Advanced tools
Comparing version 3.2.1 to 3.2.2
@@ -10,12 +10,21 @@ 'use strict'; | ||
const logLevels = ['fatal', 'error', 'warn', 'info', 'debug', 'trace']; | ||
const logLevels = Object.keys(pino.levels.values); | ||
function getLogLevel() { | ||
if ( | ||
_.isString(process.env.STRAPI_LOG_LEVEL) && | ||
_.includes(logLevels, process.env.STRAPI_LOG_LEVEL.toLowerCase()) | ||
) { | ||
return process.env.STRAPI_LOG_LEVEL; | ||
if (!_.isString(process.env.STRAPI_LOG_LEVEL)) { | ||
// Default value. | ||
return 'debug'; | ||
} | ||
return 'debug'; | ||
const logLevel = process.env.STRAPI_LOG_LEVEL.toLowerCase(); | ||
if (!_.includes(logLevels, logLevel)) { | ||
throw new Error( | ||
"Invalid log level set in STRAPI_LOG_LEVEL environment variable. Accepted values are: '" + | ||
logLevels.join("', '") + | ||
"'." | ||
); | ||
} | ||
return logLevel; | ||
} | ||
@@ -22,0 +31,0 @@ |
{ | ||
"name": "strapi-utils", | ||
"version": "3.2.1", | ||
"version": "3.2.2", | ||
"description": "Shared utilities for the Strapi packages", | ||
@@ -48,3 +48,3 @@ "homepage": "http://strapi.io", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"gitHead": "5a77b560e333604d052bfa83ad774769b5d6bc2e" | ||
"gitHead": "b3d0b7219852bf61c0b0c6eeee9462f112d99189" | ||
} |
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
91469
2706
5