Permalink
Browse files

Merge branch 'master' of git://github.com/flatiron/winston

  • Loading branch information...
2 parents 142d9fd + 8ecd17c commit 08ae1710f61d09a1929b9760b8644a13eefcf310 @calvinfo committed Aug 29, 2012
Showing with 45 additions and 2 deletions.
  1. +0 −1 .travis.yml
  2. +1 −1 README.md
  3. +44 −0 examples/custom-levels.js
View
@@ -2,7 +2,6 @@ language: node_js
node_js:
- 0.6
- 0.8
- - 0.9
notifications:
email:
View
@@ -1,4 +1,4 @@
-# winston [![Build Status](https://secure.travis-ci.org/flatiron/winston.png)](http://travis-ci.org/flatiron/winston)
+# winston [![Build Status](https://secure.travis-ci.org/flatiron/winston.png?branch=master)](http://travis-ci.org/flatiron/winston)
A multi-transport async logging library for node.js. <span style="font-size:28px; font-weight:bold;">&quot;CHILL WINSTON! ... I put it in the logs.&quot;</span>
@@ -0,0 +1,44 @@
+/*
+ * custom-levels.js: Custom logger and color levels in winston
+ *
+ * (C) 2012, Nodejitsu Inc.
+ *
+ */
+
+var winston = require('../lib/winston');
+
+//
+// Logging levels
+//
+var config = {
+ levels: {
+ silly: 0,
+ verbose: 1,
+ info: 2,
+ data: 3,
+ warn: 4,
+ debug: 5,
+ error: 6
+ },
+ colors: {
+ silly: 'magenta',
+ verbose: 'cyan',
+ info: 'green',
+ data: 'grey',
+ warn: 'yellow',
+ debug: 'blue',
+ error: 'red'
+ }
+};
+
+var logger = module.exports = new (winston.Logger)({
+ transports: [
+ new (winston.transports.Console)({
+ colorize: true
+ })
+ ],
+ levels: config.levels,
+ colors: config.colors
+});
+
+logger.data('hello')

0 comments on commit 08ae171

Please sign in to comment.