Comparing version 1.2.1 to 1.3.0
@@ -13,5 +13,10 @@ { | ||
}, | ||
"bin": "./dist/bin/index.js", | ||
"dependencies": { | ||
"boolean": "^0.1.3", | ||
"sprintf-js": "^1.1.1" | ||
"chalk": "^2.1.0", | ||
"prettyjson": "^1.2.1", | ||
"split2": "^2.2.0", | ||
"sprintf-js": "^1.1.1", | ||
"yargs": "^9.0.1" | ||
}, | ||
@@ -72,3 +77,3 @@ "description": "JSON logger for Node.js.", | ||
}, | ||
"version": "1.2.1" | ||
"version": "1.3.0" | ||
} |
@@ -23,2 +23,3 @@ # Roarr | ||
* [`fatal`](#fatal) | ||
* [CLI tool](#cli-tool) | ||
* [Transports](#transports) | ||
@@ -239,2 +240,35 @@ * [Environment variables](#environment-variables) | ||
## CLI tool | ||
Roarr comes with a CLI tool used to pretty-print logs for development purposes. | ||
To format the logs, pipe the program output to `roarr` program, e.g. | ||
```bash | ||
$ npm install roarr -g | ||
$ ROARR_LOG=true node index.js | roarr | ||
``` | ||
Provided that the `index.js` program produced an output such as: | ||
``` | ||
{"context":{"package":"forward-proxy","namespace":"createHttpProxyServer","logLevel":"info"},"message":"Internal SSL Server running on localhost:62597","sequence":0,"time":1506803138704,"version":"1.0.0"} | ||
{"context":{"package":"forward-proxy","namespace":"createRequestProcessor","logLevel":"info"},"message":"request start -> http://localhost:62595/","sequence":1,"time":1506803138741,"version":"1.0.0"} | ||
{"context":{"package":"forward-proxy","namespace":"createLogInterceptor","logLevel":"debug","headers":{"host":"localhost:62595","connection":"close"}},"message":"received request","sequence":2,"time":1506803138741,"version":"1.0.0"} | ||
{"context":{"package":"forward-proxy","namespace":"createRequestProcessor","logLevel":"info"},"message":"request finished <- http://localhost:62595/","sequence":3,"time":1506803138749,"version":"1.0.0"} | ||
{"context":{"package":"forward-proxy","namespace":"createLogInterceptor","logLevel":"info","method":"GET","requestHeaders":{"host":"localhost:62595","connection":"close"},"responseHeaders":{"date":"Sat, 30 Sep 2017 20:25:38 GMT","connection":"close","content-length":"7","x-forward-proxy-request-id":"2b746d92-1a8b-4f36-b3cc-5bff57dad94d","x-forward-proxy-cache-hit":"false"},"statusCode":200,"url":"http://localhost:62595/"},"message":"response","sequence":4,"time":1506803138755,"version":"1.0.0"} | ||
{"context":{"package":"forward-proxy","namespace":"createLogInterceptor","logLevel":"info","method":"GET","requestHeaders":{"host":"localhost:62595","connection":"close"},"responseHeaders":{"date":"Sat, 30 Sep 2017 20:25:38 GMT","content-length":"7","x-forward-proxy-request-id":"2b746d92-1a8b-4f36-b3cc-5bff57dad94d","x-forward-proxy-cache-hit":"true"},"statusCode":200,"url":"http://localhost:62595/"},"message":"response","sequence":5,"time":1506803138762,"version":"1.0.0"} | ||
``` | ||
`roarr` CLI program will format the output to look like this: | ||
![CLI output demo](./.README/cli-output-demo.png) | ||
* `@` prefixed value denotes the name of the package. | ||
* `#` prefixed value denotes the namespace. | ||
Explore other CLI options using `roar --help`. | ||
## Transports | ||
@@ -241,0 +275,0 @@ |
38810
20
239
343
6
+ Addedchalk@^2.1.0
+ Addedprettyjson@^1.2.1
+ Addedsplit2@^2.2.0
+ Addedyargs@^9.0.1
+ Addedansi-regex@2.1.13.0.1(transitive)
+ Addedansi-styles@3.2.1(transitive)
+ Addedcamelcase@4.1.0(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcliui@3.2.0(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedcolors@1.4.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedcross-spawn@5.1.0(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedexeca@0.7.0(transitive)
+ Addedfind-up@2.1.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-caller-file@1.0.3(transitive)
+ Addedget-stream@3.0.0(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedinvert-kv@1.0.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-fullwidth-code-point@1.0.02.0.0(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedlcid@1.0.0(transitive)
+ Addedload-json-file@2.0.0(transitive)
+ Addedlocate-path@2.0.0(transitive)
+ Addedlru-cache@4.1.5(transitive)
+ Addedmem@1.1.0(transitive)
+ Addedmimic-fn@1.2.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addednpm-run-path@2.0.2(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedos-locale@2.1.0(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-limit@1.3.0(transitive)
+ Addedp-locate@2.0.0(transitive)
+ Addedp-try@1.0.0(transitive)
+ Addedparse-json@2.2.0(transitive)
+ Addedpath-exists@3.0.0(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@2.0.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedprettyjson@1.2.5(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedpseudomap@1.0.2(transitive)
+ Addedread-pkg@2.0.0(transitive)
+ Addedread-pkg-up@2.0.0(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedrequire-main-filename@1.0.1(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedsplit2@2.2.0(transitive)
+ Addedstring-width@1.0.22.1.1(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstrip-ansi@3.0.14.0.0(transitive)
+ Addedstrip-bom@3.0.0(transitive)
+ Addedstrip-eof@1.0.0(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedthrough2@2.0.5(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwhich-module@2.0.1(transitive)
+ Addedwrap-ansi@2.1.0(transitive)
+ Addedxtend@4.0.2(transitive)
+ Addedy18n@3.2.2(transitive)
+ Addedyallist@2.1.2(transitive)
+ Addedyargs@9.0.1(transitive)
+ Addedyargs-parser@7.0.0(transitive)