Skip to content

Commit

Permalink
fix: put default level threshold to notice
Browse files Browse the repository at this point in the history
As it's about messages that are important to expose,
altough do not indicate any issue
  • Loading branch information
medikoo committed Jun 1, 2018
1 parent 22028bc commit e994285
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
6 changes: 3 additions & 3 deletions test/writer-utils/setup-visibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand All @@ -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();
});

Expand Down
2 changes: 1 addition & 1 deletion writer-utils/setup-visibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit e994285

Please sign in to comment.