-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dropping args and replacing by minimist
- Loading branch information
1 parent
3dbcd21
commit 1d46ccd
Showing
5 changed files
with
118 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Usage: pino pretty [options] [command] | ||
|
||
Commands: | ||
help Display help | ||
version Display version | ||
|
||
Options: | ||
-c, --colorize Force adding color sequences to the output | ||
-C, --config specify a path to a json file containing the pino-pretty options | ||
-f, --crlf Append CRLF instead of LF to formatted lines | ||
-X, --customColors Override default colors using names from https://www.npmjs.com/package/colorette (`-X err:red,info:blue`) | ||
-x, --customLevels Override default levels (`-x err:99,info:1`) | ||
-k, --errorLikeObjectKeys Define which keys contain error objects (`-k err,error`) (defaults to `err,error`) | ||
-e, --errorProps Comma separated list of properties on error objects to show (`*` for all properties) (defaults to ``) | ||
-h, --help Output usage information | ||
-H, --hideObject Hide objects from output (but not error object) | ||
-i, --ignore Ignore one or several keys: (`-i time,hostname`) | ||
-l, --levelFirst Display the log level as the first output field | ||
-L, --levelKey [value] Detect the log level under the specified key (defaults to "level") | ||
-b, --levelLabel [value] Output the log level using the specified label (defaults to "levelLabel") | ||
-o, --messageFormat Format output of message | ||
-m, --messageKey [value] Highlight the message under the specified key (defaults to "msg") | ||
-L, --minimumLevel Hide messages below the specified log level | ||
-S, --singleLine Print all non-error objects on a single line | ||
-a, --timestampKey [value] Display the timestamp from the specified key (defaults to "time") | ||
-t, --translateTime Display epoch timestamps as UTC ISO format or according to an optional format string (default ISO 8601) | ||
-U, --useOnlyCustomProps Only use custom levels and colors (if provided); don't fallback to default levels and colors (-U false) | ||
-v, --version Output the version number | ||
|
||
Examples: | ||
- To prettify logs, simply pipe a log file through | ||
$ cat log | pino-pretty | ||
|
||
- To highlight a string at a key other than 'msg' | ||
$ cat log | pino-pretty -m fooMessage | ||
|
||
- To detect the log level at a key other than 'level' | ||
$ cat log | pino-pretty --levelKey fooLevel | ||
|
||
- To output the log level label using a key other than 'levelLabel' | ||
$ cat log | pino-pretty --levelLabel LVL -o "{LVL}" | ||
|
||
- To display timestamp from a key other than 'time' | ||
$ cat log | pino-pretty -a fooTimestamp | ||
|
||
- To convert Epoch timestamps to ISO timestamps use the -t option | ||
$ cat log | pino-pretty -t | ||
|
||
- To convert Epoch timestamps to local timezone format use the -t option with "SYS:" prefixed format string | ||
$ cat log | pino-pretty -t "SYS:yyyy-mm-dd HH:MM:ss" | ||
|
||
- To flip level and time/date in standard output use the -l option | ||
$ cat log | pino-pretty -l | ||
|
||
- Only prints messages with a minimum log level of info | ||
$ cat log | pino-pretty -L info | ||
|
||
- Prettify logs but don't print pid and hostname | ||
$ cat log | pino-pretty -i pid,hostname | ||
|
||
- Loads options from a config file | ||
$ cat log | pino-pretty --config=/path/to/config.json | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters