Skip to content

Commit

Permalink
Added file example
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Sep 26, 2010
1 parent 928e32b commit 9b4da77
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
18 changes: 18 additions & 0 deletions examples/file.js
@@ -0,0 +1,18 @@

/**
* Module dependencies.
*/

var Log = require('../lib/log')
, fs = require('fs')
, stream = fs.createWriteStream(__dirname + '/file.log')
, log = new Log('debug', stream);

log.debug('a debug message');
log.info('a info message');
log.notice('a notice message');
log.warning('a warning message');
log.error('a error message');
log.critical('a critical message');
log.alert('a alert message');
log.emergency('a emergency message');
8 changes: 8 additions & 0 deletions examples/file.log
@@ -0,0 +1,8 @@
[Sun, 26 Sep 2010 01:10:23 GMT] DEBUG a debug message
[Sun, 26 Sep 2010 01:10:23 GMT] INFO a info message
[Sun, 26 Sep 2010 01:10:23 GMT] NOTICE a notice message
[Sun, 26 Sep 2010 01:10:23 GMT] WARNING a warning message
[Sun, 26 Sep 2010 01:10:23 GMT] ERROR a error message
[Sun, 26 Sep 2010 01:10:23 GMT] CRITICAL a critical message
[Sun, 26 Sep 2010 01:10:23 GMT] ALERT a alert message
[Sun, 26 Sep 2010 01:10:23 GMT] EMERGENCY a emergency message
2 changes: 1 addition & 1 deletion examples/stdout.js
Expand Up @@ -3,7 +3,7 @@
* Module dependencies.
*/

var Log = require('./lib/log')
var Log = require('../lib/log')
, log = new Log('notice');

log.debug('a debug message');
Expand Down

0 comments on commit 9b4da77

Please sign in to comment.