Browse files

Edited README.md via GitHub

  • Loading branch information...
1 parent d2b3fac commit 4dcd05edfad45bfd6ad93eab9a136d6645c3d659 @pquerna committed Mar 19, 2011
Showing with 7 additions and 13 deletions.
  1. +7 −13 README.md
View
20 README.md
@@ -8,26 +8,20 @@ Getting Started
If you had a file named like, "lib/foo/bar.js", at the top of it, you would put the following:
-```var log = require('logmagic').local('mylib.foo.bar');```
+ var log = require('logmagic').local('mylib.foo.bar');
Then inside bar.js, you would just use the logger like any normal logger:
-```
- log.info("Hello!")
- log.error("Accepts format strings too ${SOME_VAR}", {SOME_VAR: "myvalue"})
-```
+ log.info("Hello!")
+ log.error("Accepts format strings too ${SOME_VAR}", {SOME_VAR: "myvalue"})
In any other part of your application, you can reconfigure the logging subsystem at runtime,
making it easy to change log levels for specific modules dynamically.
-```
- var logmagic = require('logmagic');
- logmagic.registerSink("mysink", function(level, message) { console.log(message); });
-
- /* Reconfigure all children of mylib to log all debug messages to your custom sink */
- logmagic.route("mylib.*", logmagic.DEBUG, "mysink")
-
-```
+ var logmagic = require('logmagic');
+ logmagic.registerSink("mysink", function(level, message) { console.log(message); });
+ /* Reconfigure all children of mylib to log all debug messages to your custom sink */
+ logmagic.route("mylib.*", logmagic.DEBUG, "mysink")
Builtin sinks include:

0 comments on commit 4dcd05e

Please sign in to comment.