pino-pretty
Advanced tools
Comparing version 5.1.3 to 6.0.0
'use strict' | ||
const chalk = require('chalk') | ||
const { options: coloretteOptions } = require('colorette') | ||
const jmespath = require('jmespath') | ||
@@ -28,3 +28,3 @@ const colors = require('./lib/colors') | ||
const defaultOptions = { | ||
colorize: chalk.supportsColor, | ||
colorize: coloretteOptions.enabled, | ||
crlf: false, | ||
@@ -31,0 +31,0 @@ errorLikeObjectKeys: ERROR_LIKE_KEYS, |
@@ -18,14 +18,13 @@ 'use strict' | ||
const chalk = require('chalk') | ||
const ctx = new chalk.Instance({ level: 3 }) | ||
const colorette = require('colorette') | ||
const colored = { | ||
default: ctx.white, | ||
60: ctx.bgRed, | ||
50: ctx.red, | ||
40: ctx.yellow, | ||
30: ctx.green, | ||
20: ctx.blue, | ||
10: ctx.grey, | ||
message: ctx.cyan, | ||
greyMessage: ctx.grey | ||
default: colorette.white, | ||
60: colorette.bgRed, | ||
50: colorette.red, | ||
40: colorette.yellow, | ||
30: colorette.green, | ||
20: colorette.blue, | ||
10: colorette.gray, | ||
message: colorette.cyan, | ||
greyMessage: colorette.gray | ||
} | ||
@@ -32,0 +31,0 @@ |
@@ -190,3 +190,3 @@ 'use strict' | ||
} else { | ||
// Print only sepcified properties unless the property is a standard exclusion. | ||
// Print only specified properties unless the property is a standard exclusion. | ||
propertiesToPrint = errorProperties.filter(k => excludeProperties.includes(k) === false) | ||
@@ -193,0 +193,0 @@ } |
{ | ||
"name": "pino-pretty", | ||
"version": "5.1.3", | ||
"version": "6.0.0", | ||
"description": "Prettifier for Pino log lines", | ||
@@ -12,5 +12,5 @@ "type": "commonjs", | ||
"scripts": { | ||
"ci": "standard && tap 'test/**/*.test.js' --coverage-report=lcovonly && npm run test-types", | ||
"ci": "standard && tap --color --coverage-report=lcovonly && npm run test-types", | ||
"lint": "standard | snazzy", | ||
"test": "tap --100 'test/**/*.test.js'", | ||
"test": "tap --100 --color", | ||
"test-types": "tsc && tsd" | ||
@@ -38,3 +38,3 @@ }, | ||
"args": "^5.0.1", | ||
"chalk": "^4.0.0", | ||
"colorette": "^1.3.0", | ||
"dateformat": "^4.5.1", | ||
@@ -41,0 +41,0 @@ "fast-safe-stringify": "^2.0.7", |
@@ -137,3 +137,3 @@ <a id="intro"></a> | ||
{ | ||
colorize: chalk.supportsColor, // --colorize | ||
colorize: colorette.options.enabled, // --colorize | ||
crlf: false, // --crlf | ||
@@ -157,3 +157,3 @@ errorLikeObjectKeys: ['err', 'error'], // --errorLikeObjectKeys | ||
The `colorize` default follows | ||
[`chalk.supportsColor`](https://www.npmjs.com/package/chalk#chalksupportscolor). | ||
[`colorette.options.enabled`](https://github.com/jorgebucaran/colorette#optionsenabled). | ||
@@ -160,0 +160,0 @@ `customPrettifiers` option provides the ability to add a custom prettify function |
@@ -10,2 +10,3 @@ 'use strict' | ||
const logLine = '{"level":30,"time":1522431328992,"msg":"hello world","pid":42,"hostname":"foo"}\n' | ||
const env = { TERM: 'dumb' } | ||
@@ -15,3 +16,2 @@ test('cli', (t) => { | ||
t.plan(1) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin], { env }) | ||
@@ -29,3 +29,2 @@ child.on('error', t.threw) | ||
t.plan(1) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin, optionName], { env }) | ||
@@ -44,3 +43,2 @@ child.on('error', t.threw) | ||
t.plan(1) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin, optionName], { env }) | ||
@@ -59,3 +57,2 @@ child.on('error', t.threw) | ||
t.plan(1) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin, optionName, 'msg == `hello world`'], { env }) | ||
@@ -73,3 +70,2 @@ child.on('error', t.threw) | ||
t.plan(1) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin, '-s', 'msg == `hello world`'], { env }) | ||
@@ -88,3 +84,2 @@ child.on('error', t.threw) | ||
t.plan(1) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin, optionName, 'pid,hostname'], { env }) | ||
@@ -102,3 +97,2 @@ child.on('error', t.threw) | ||
t.plan(1) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin, '-i', 'log\\.domain\\.corp/foo'], { env }) | ||
@@ -116,3 +110,2 @@ child.on('error', t.threw) | ||
t.plan(1) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin], { env }) | ||
@@ -136,3 +129,2 @@ child.on('error', t.threw) | ||
t.plan(1) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin, optionName, '@timestamp'], { env }) | ||
@@ -159,3 +151,2 @@ child.on('error', t.threw) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin, optionName], { env }) | ||
@@ -184,3 +175,2 @@ child.on('error', t.threw) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin, '-S', '-i', 'extra.foo,extra.nested,extra.nested.miss'], { env }) | ||
@@ -187,0 +177,0 @@ child.on('error', t.threw) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
297998
26
2954
+ Addedcolorette@^1.3.0
+ Addedcolorette@1.4.0(transitive)
- Removedchalk@^4.0.0
- Removedansi-styles@4.3.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedsupports-color@7.2.0(transitive)