Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 08ae1710f61d09a1929b9760b8644a13eefcf310 2 parents 142d9fd + 8ecd17c
Calvin French-Owen calvinfo authored

Showing 3 changed files with 45 additions and 2 deletions. Show diff stats Hide diff stats

  1. +0 1  .travis.yml
  2. +1 1  README.md
  3. +44 0 examples/custom-levels.js
1  .travis.yml
@@ -2,7 +2,6 @@ language: node_js
2 2 node_js:
3 3 - 0.6
4 4 - 0.8
5   - - 0.9
6 5
7 6 notifications:
8 7 email:
2  README.md
Source Rendered
... ... @@ -1,4 +1,4 @@
1   -# winston [![Build Status](https://secure.travis-ci.org/flatiron/winston.png)](http://travis-ci.org/flatiron/winston)
  1 +# winston [![Build Status](https://secure.travis-ci.org/flatiron/winston.png?branch=master)](http://travis-ci.org/flatiron/winston)
2 2
3 3 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>
4 4
44 examples/custom-levels.js
... ... @@ -0,0 +1,44 @@
  1 +/*
  2 + * custom-levels.js: Custom logger and color levels in winston
  3 + *
  4 + * (C) 2012, Nodejitsu Inc.
  5 + *
  6 + */
  7 +
  8 +var winston = require('../lib/winston');
  9 +
  10 +//
  11 +// Logging levels
  12 +//
  13 +var config = {
  14 + levels: {
  15 + silly: 0,
  16 + verbose: 1,
  17 + info: 2,
  18 + data: 3,
  19 + warn: 4,
  20 + debug: 5,
  21 + error: 6
  22 + },
  23 + colors: {
  24 + silly: 'magenta',
  25 + verbose: 'cyan',
  26 + info: 'green',
  27 + data: 'grey',
  28 + warn: 'yellow',
  29 + debug: 'blue',
  30 + error: 'red'
  31 + }
  32 +};
  33 +
  34 +var logger = module.exports = new (winston.Logger)({
  35 + transports: [
  36 + new (winston.transports.Console)({
  37 + colorize: true
  38 + })
  39 + ],
  40 + levels: config.levels,
  41 + colors: config.colors
  42 +});
  43 +
  44 +logger.data('hello')

0 comments on commit 08ae171

Please sign in to comment.
Something went wrong with that request. Please try again.