Comparing version 3.1.1 to 3.1.2
{ | ||
"name": "pino", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "super fast, all natural json logger", | ||
@@ -5,0 +5,0 @@ "main": "pino.js", |
@@ -10,2 +10,3 @@ #! /usr/bin/env node | ||
var levels = { | ||
default: 'USERLVL', | ||
60: 'FATAL', | ||
@@ -74,2 +75,3 @@ 50: 'ERROR', | ||
levelColors = { | ||
default: ctx.white, | ||
60: ctx.bgRed, | ||
@@ -133,3 +135,7 @@ 50: ctx.red, | ||
function asColoredLevel (value) { | ||
return levelColors[value.level](levels[value.level]) | ||
if (levelColors.hasOwnProperty(value.level)) { | ||
return levelColors[value.level](levels[value.level]) | ||
} else { | ||
return levelColors.default(levels.default) | ||
} | ||
} | ||
@@ -136,0 +142,0 @@ } |
@@ -175,1 +175,15 @@ 'use strict' | ||
}) | ||
test('accept customLogLevvel', function (t) { | ||
t.plan(1) | ||
var pretty = pino.pretty() | ||
pretty.pipe(split(function (line) { | ||
t.ok(line.indexOf('USERLVL') > 0, 'include custom level') | ||
return line | ||
})) | ||
var instance = pino({level: 'testCustom', levelVal: 35}, pretty) | ||
instance.testCustom('test message') | ||
}) |
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
101714
2265