log-segment
Advanced tools
Comparing version 1.3.2 to 1.4.0
20
main.js
@@ -114,2 +114,22 @@ 'use strict' | ||
} | ||
if (params.disabled) { | ||
if (Array.isArray(params.disabled.segments) && __enabled.segments) { | ||
if (__enabled.segments === '*') { | ||
__enabled.segments = Object.keys(__segments) | ||
} | ||
__enabled.segments = __enabled.segments.filter((segment) => { | ||
return params.disabled.segments.indexOf(segment) | ||
}) | ||
} | ||
if (Array.isArray(params.disabled.levels) && __enabled.levels) { | ||
if (__enabled.levels === '*') { | ||
__enabled.levels = Object.keys(__levels) | ||
} | ||
__enabled.levels = __enabled.levels.filter((level) => { | ||
return params.disabled.levels.indexOf(level) | ||
}) | ||
} | ||
} | ||
} | ||
@@ -116,0 +136,0 @@ |
{ | ||
"name": "log-segment", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"description": "logger with partition", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
@@ -211,2 +211,9 @@ # log-segment | ||
**Beta** | ||
Enable all segments, disable info and success level | ||
````js | ||
log.set({ disabled: { levels: ['info', 'success'] } }) | ||
```` | ||
**Production** | ||
@@ -213,0 +220,0 @@ |
23283
537
341