Skip to content

Commit feefb95

Browse files
authored
Update README.md
Update supported node versions. Add information regarding trace. Add information regarding expansion of console.
1 parent b3a0d0e commit feefb95

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ $ npm install karl --production
4343
for a production only installation (no tests, documentation, ...).
4444

4545
## Supported Node Versions
46-
`Karl` supports `Node` versions 0.12 and later.
47-
To use `Karl` with `Node` version < 4.0, you must start `node` with the `--harmony` flag.
46+
`Karl` supports `Node` versions 4.7.1 and later.
47+
It is only tested on LTS versions.
4848

4949
## Usage
5050
``` js
5151
var karl = require('karl');
5252

53+
karl.trace("Are you spying on me?");
5354
karl.debug("Everything looks fine.");
5455
karl.info("Need some more info huh?");
5556
karl.warn("Didn't you forget something?");
@@ -60,6 +61,7 @@ for a production only installation (no tests, documentation, ...).
6061
Output:
6162

6263
```sh
64+
{"timestamp":"2015-08-02T18:02:39.456Z","level":"TRACE","hostName":"<hidden>","process":{"name":"karltest","pid":26693},"message":"Are you spying on me?","fileName":"karltest.js","lineNumber":40,"functionName":"<anonymous>"}
6365
{"timestamp":"2015-08-02T18:02:39.456Z","level":"DEBUG","hostName":"<hidden>","process":{"name":"karltest","pid":26693},"message":"Everything looks fine.","fileName":"karltest.js","lineNumber":41,"functionName":"<anonymous>"}
6466
{"timestamp":"2015-08-02T18:02:39.456Z","level":"INFO","hostName":"<hidden>","process":{"name":"karltest","pid":26693},"message":"Need some more info huh?","fileName":"karltest.js","lineNumber":42,"functionName":"<anonymous>"}
6567
{"timestamp":"2015-08-02T18:02:39.456Z","level":"WARN","hostName":"<hidden>","process":{"name":"karltest","pid":26693},"message":"Didn't you forget something?","fileName":"karltest.js","lineNumber":43,"functionName":"<anonymous>"}
@@ -133,8 +135,9 @@ karl.setOptions({ includeLocationInformation: true }); //turns location informa
133135
Location information is included by default and must be disabled explicitly.
134136

135137
## Console Redirection
136-
By default Karl redirects all `console` output to its own logger.
137-
As a consequence, all console messages are decorated with location information and a timestamp.
138+
By default Karl redirects all `console` output to its own logger.
139+
As a consequence, all console messages are decorated with location information and a timestamp.
140+
Karl also adds a debug() and trace() method to the console.
138141

139142
`console.info("Hi there!")` is exactly the same as `karl.info("Hi there!")`.
140143
The `console.log()` method is redirected to `karl.info()`.
@@ -146,7 +149,7 @@ karl.setOptions({ redirectConsole: false });
146149
```
147150

148151
## UncaughtException
149-
Karl catches any uncaught exception (see [Event 'uncaughtException'](https://nodejs.org/api/process.html#process_event_uncaughtexception)).
152+
Karl catches any uncaught exception (see [Event 'uncaughtException'](https://nodejs.org/api/process.html#process_event_uncaughtexception)).
150153
When such an exception occurs, Karl logs a fatal log message (including stack trace) and then gracefully shuts down the process by emitting a `SIGINT` signal.
151154

152155

0 commit comments

Comments
 (0)