munia-pretty-json
v0.2.2
Published
Convert the JSON log into readable form with command line.
Downloads
7
Maintainers
Readme
munia-pretty-json
Convert the JSON log into readable form with command line. JSON logs can also be viewed as gird/table form on console.
Installation
npm install -g munia-pretty-json
Example
JSON log records (app-log.json):
{"time":"2021-06-09T02:50:22Z","level":"info","message":"Log for pretty JSON","module":"init","hostip":"192.168.0.138","pid":123}
{"time":"2021-06-09T03:27:43Z","level":"warn","message":"Here is warning message","module":"send-message","hostip":"192.168.0.138","pid":123}
Run the commond munia-pretty-json on shell:
$ munia-pretty-json app-log.json
This turns the JSON to:
With this tool the main feature is template that prettifies easily the JSON. Here is an example of template:
$ munia-pretty-json --template '{module --color} - {level} - {message}' app-log.json
Usage
Testing
npm test
License
Licensed under MIT.