Socket
Socket
Sign inDemoInstall

pino

Package Overview
Dependencies
Maintainers
2
Versions
310
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino - npm Package Compare versions

Comparing version 2.4.4 to 2.5.0

2

package.json
{
"name": "pino",
"version": "2.4.4",
"version": "2.5.0",
"description": "fast and simple logger",

@@ -5,0 +5,0 @@ "main": "pino.js",

@@ -22,2 +22,9 @@ 'use strict'

}
// private property
Object.defineProperty(levels, 'silent', {
value: 100,
enumerable: false
})
var nums = Object.keys(levels).reduce(function (o, k) {

@@ -28,2 +35,8 @@ o[levels[k]] = k

// private property
Object.defineProperty(nums, '100', {
value: 'silent',
enumerable: false
})
function pino (opts, stream) {

@@ -49,2 +62,6 @@ if (opts && opts._writableState) {

if (opts.enabled === false) {
level = 'silent'
}
var logger = new Pino(level, stream, serializers, stringify, end, name, hostname, slowtime, '', cache, formatOpts)

@@ -51,0 +68,0 @@ if (cache) {

@@ -192,2 +192,4 @@ # pino  [![Build Status](https://travis-ci.org/mcollina/pino.svg)](https://travis-ci.org/mcollina/pino)

* `extreme`: Enables extreme mode, yields an additional 60% performance (from 250ms down to 100ms per 10000 ops). There are trade-off's should be understood before usage. See [Extreme mode explained](#extreme). default `false`
* `level`: one of `'fatal'`, `'error'`, `'warn'`, `'info`', `'debug'`, `'trace'`; also `'silent'` is supported to disable logging.
* `enabled`: enables logging, defaults to `true`.

@@ -296,4 +298,6 @@ `stream` is a Writable stream, defaults to `process.stdout`.

The logging level is a *minimum* level. For instance if `logger.level` is `'info'` then all `fatal`, `error`, `warn`, and `info` logs will be enabled.
The logging level is a *minimum* level. For instance if `logger.level` is `'info'` then all `'fatal'`, `'error'`, `'warn'`, and `'info'` logs will be enabled.
You can pass `'silent'` to disable logging.
<a name="fatal"></a>

@@ -300,0 +304,0 @@ ### logger.fatal([obj], msg, [...])

@@ -727,2 +727,66 @@ 'use strict'

test('enable', function (t) {
var instance = pino({
level: 'trace',
enabled: false
}, sink(function (chunk, enc, cb) {
t.fail('no data should be logged')
}))
Object.keys(pino.levels.values).forEach(function (level) {
instance[level]('hello world')
})
t.end()
})
test('silent level', function (t) {
var instance = pino({
level: 'silent'
}, sink(function (chunk, enc, cb) {
t.fail('no data should be logged')
}))
Object.keys(pino.levels.values).forEach(function (level) {
instance[level]('hello world')
})
t.end()
})
test('setting level to 100', function (t) {
var instance = pino({
level: 100
}, sink(function (chunk, enc, cb) {
t.fail('no data should be logged')
}))
Object.keys(pino.levels.values).forEach(function (level) {
instance[level]('hello world')
})
t.end()
})
test('exposed levels', function (t) {
t.plan(1)
t.deepEqual(Object.keys(pino.levels.values), [
'fatal',
'error',
'warn',
'info',
'debug',
'trace'
])
})
test('exposed labels', function (t) {
t.plan(1)
t.deepEqual(Object.keys(pino.levels.labels), [
'10',
'20',
'30',
'40',
'50',
'60'
])
})
test('level-change event', function (t) {

@@ -729,0 +793,0 @@ var instance = pino()

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc