pino-pretty
Advanced tools
+1
-0
@@ -43,2 +43,3 @@ #!/usr/bin/env node | ||
| colorize: 'c', | ||
| colorizeObjects: 'C', | ||
| crlf: 'f', | ||
@@ -45,0 +46,0 @@ errorProps: 'e', |
+5
-0
@@ -111,2 +111,7 @@ // Type definitions for pino-pretty 7.0 | ||
| /** | ||
| * If set to false while `colorize` is `true`, will output JSON objects without color. | ||
| * @default true | ||
| */ | ||
| colorizeObjects?: boolean; | ||
| /** | ||
| * Appends carriage return and line feed, instead of just a line feed, to the formatted log line. | ||
@@ -113,0 +118,0 @@ * @default false |
+3
-1
@@ -34,2 +34,3 @@ 'use strict' | ||
| colorize: isColorSupported, | ||
| colorizeObjects: true, | ||
| crlf: false, | ||
@@ -100,2 +101,3 @@ errorLikeObjectKeys: ERROR_LIKE_KEYS, | ||
| const colorizer = colors(opts.colorize, customColors, useOnlyCustomProps) | ||
| const objectColorizer = opts.colorizeObjects ? colorizer : colors(false, [], false) | ||
@@ -198,3 +200,3 @@ return pretty | ||
| singleLine, | ||
| colorizer | ||
| colorizer: objectColorizer | ||
| }) | ||
@@ -201,0 +203,0 @@ |
+1
-1
| { | ||
| "name": "pino-pretty", | ||
| "version": "9.3.0", | ||
| "version": "9.4.0", | ||
| "description": "Prettifier for Pino log lines", | ||
@@ -5,0 +5,0 @@ "type": "commonjs", |
+2
-0
@@ -60,2 +60,3 @@ <a id="intro"></a> | ||
| - `--colorize` (`-c`): Adds terminal color escape sequences to the output. | ||
| - `--colorizeObjects` (`-C`): Allows suppressing colorization of objects when set to `false`. In combination with `--singleLine`, this ensures that the end of each line is parsable JSON. | ||
| - `--crlf` (`-f`): Appends carriage return and line feed, instead of just a line | ||
@@ -239,2 +240,3 @@ feed, to the formatted log line. | ||
| colorize: colorette.isColorSupported, // --colorize | ||
| colorizeObjects: true, //--colorizeObjects | ||
| crlf: false, // --crlf | ||
@@ -241,0 +243,0 @@ errorLikeObjectKeys: ['err', 'error'], // --errorLikeObjectKeys |
+16
-0
@@ -85,2 +85,18 @@ 'use strict' | ||
| t.test('will omit color codes from objects when colorizeObjects = false', (t) => { | ||
| t.plan(1) | ||
| const pretty = prettyFactory({ colorize: true, singleLine: true, colorizeObjects: false }) | ||
| const log = pino({}, new Writable({ | ||
| write (chunk, enc, cb) { | ||
| const formatted = pretty(chunk.toString()) | ||
| t.equal( | ||
| formatted, | ||
| `[${formattedEpoch}] \u001B[32mINFO\u001B[39m (${pid}): \u001B[36mfoo\u001B[39m {"foo":"bar"}\n` | ||
| ) | ||
| cb() | ||
| } | ||
| })) | ||
| log.info({ foo: 'bar' }, 'foo') | ||
| }) | ||
| t.test('can swap date and level position', (t) => { | ||
@@ -87,0 +103,0 @@ t.plan(1) |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
184883
0.59%4089
0.57%370
0.54%