Skip to content

Commit

Permalink
[FIX] Fix handling of log level "silent"
Browse files Browse the repository at this point in the history
npmlog already supports this level. We just forgot to add it to our
list, causing errors like "Failed to find current log level
"silent" in list of expected log levels" when checking for enabled log
levels.
  • Loading branch information
RandomByte committed Oct 14, 2019
1 parent 38d0e10 commit 020ced8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/logger.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const npmlog = require("npmlog");

const levels = ["silly", "verbose", "info", "warn", "error"];
const levels = ["silly", "verbose", "info", "warn", "error", "silent"];
if (process.env.UI5_LOG_LVL) {
const logLvl = process.env.UI5_LOG_LVL;
if (!levels.includes(logLvl)) {
Expand Down Expand Up @@ -129,6 +129,9 @@ module.exports = {
},

setLevel(level) {
if (!levels.includes(level)) {
throw new Error(`Unkown log level "${level}"`);
}
return npmlog.level = level;
},

Expand Down

0 comments on commit 020ced8

Please sign in to comment.