Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 08ae1710f61d09a1929b9760b8644a13eefcf310 2 parents 142d9fd + 8ecd17c
@calvinfo calvinfo authored
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
1  .travis.yml
@@ -2,7 +2,6 @@ language: node_js
node_js:
- 0.6
- 0.8
- - 0.9
notifications:
email:
View
2  README.md
@@ -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>
View
44 examples/custom-levels.js
@@ -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')
Please sign in to comment.
Something went wrong with that request. Please try again.