Permalink
Browse files

first commit

  • Loading branch information...
pquerna committed Mar 19, 2011
0 parents commit 5d2858fc4929c440f283aa3f2507de4fd0f7e7bb
Showing with 32 additions and 0 deletions.
  1. +32 −0 README.md
@@ -0,0 +1,32 @@
+Welcome to Log Magic.
+====================
+
+This project isn't usable yet. No promises. The Bellow is an idea.
+
+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');
+
+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"})
+
+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")
+
+Builtin sinks include:
+
+* Standard Out, Standard Error
+* Facebook Scribe: https://github.com/facebook/scribe
+* File
+* Unix Socket
+* Syslog

0 comments on commit 5d2858f

Please sign in to comment.