Permalink
Browse files

Updated..

  • Loading branch information...
1 parent 9c9e0b7 commit 39a02c3e85ea8d6e5a37a2e72dd0f6c794bbe85d @fabianishere committed Jan 2, 2012
Showing with 23 additions and 0 deletions.
  1. +14 −0 lib/handler/file.js
  2. +9 −0 test/filehandler.js
View
14 lib/handler/file.js
@@ -0,0 +1,14 @@
+var SimpleFormatter = require('../formatter/simple');
+
+/**
+ * This {@link Handler} publishes log records to <code>STDERR</code>.
+ * By default the {@link SimpleFormatter} is used to generate brief summaries.
+ *
+ * @author Fabian M.
+ */
+module.exports = function() {
+ var formatter = this.formatter = new SimpleFormatter();
+ this.publish = function(logrecord) {
+ console.error(formatter.format(logrecord));
+ };
+};
View
9 test/filehandler.js
@@ -0,0 +1,9 @@
+/**
+ * Hello world for NodeLog.
+ *
+ * @author Fabian M.
+ */
+var FileHandler = require('../lib/handler/file')
+var logger = require('../lib/logger').getLogger("HelloWorldService").addHandler(new FileHandler("file.log"));
+
+logger.info("This will be printed to a file");

0 comments on commit 39a02c3

Please sign in to comment.