From e9942855463dfb2a4e26a5de9e3a3d43a1161b43 Mon Sep 17 00:00:00 2001 From: Mariusz Nowak Date: Fri, 1 Jun 2018 22:20:21 +0200 Subject: [PATCH] fix: put default level threshold to notice As it's about messages that are important to expose, altough do not indicate any issue --- README.md | 2 +- test/writer-utils/setup-visibility.js | 6 +++--- writer-utils/setup-visibility.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ade7dcc..221a9bf 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ Default visibility depends on the enviroment (see chosen log writer for more inf ###### `LOG_LEVEL` -(defaults to `warning`) Lowest log level from which (upwards) all logs will be exposed. +(defaults to `notice`) Lowest log level from which (upwards) all logs will be exposed. ###### `LOG_DEBUG` diff --git a/test/writer-utils/setup-visibility.js b/test/writer-utils/setup-visibility.js index f804119..470433b 100644 --- a/test/writer-utils/setup-visibility.js +++ b/test/writer-utils/setup-visibility.js @@ -120,7 +120,7 @@ test("Logs visibility setup", function (t) { t.end(); }); - t.test("Fallbacks to warning level as threshold, if invalid one is provided", function (t) { + t.test("Fallbacks to notice level as threshold, if invalid one is provided", function (t) { requireUncached( [require.resolve("../../"), require.resolve("../../writer-utils/setup-visibility")], function () { @@ -131,8 +131,8 @@ test("Logs visibility setup", function (t) { setupEnv("bla", [""]); - t.equal(log.notice.isEnabled, false); - t.equal(log.warning.isEnabled, true); + t.equal(log.info.isEnabled, false); + t.equal(log.notice.isEnabled, true); t.end(); }); diff --git a/writer-utils/setup-visibility.js b/writer-utils/setup-visibility.js index 43ad1cd..7e9b77d 100644 --- a/writer-utils/setup-visibility.js +++ b/writer-utils/setup-visibility.js @@ -13,7 +13,7 @@ module.exports = function (thresholdLevelName, debugNamespacesTokens) { // Resolve intended logging level configuration // On this level and above all logs will be exposed if (!thresholdLevelName || !includes.call(levels, thresholdLevelName)) { - thresholdLevelName = "warning"; + thresholdLevelName = "notice"; } var thresholdLevelIndex = levels.indexOf(thresholdLevelName);