file.js 458 B

123456789101112131415161718
  1. /**
  2. * Module dependencies.
  3. */
  4. var Log = require('../lib/log')
  5. , fs = require('fs')
  6. , stream = fs.createWriteStream(__dirname + '/file.log', { flags: 'a' })
  7. , log = new Log('debug', stream);
  8. log.debug('a debug message');
  9. log.info('a info message');
  10. log.notice('a notice message');
  11. log.warning('a warning message');
  12. log.error('a error message');
  13. log.critical('a critical message');
  14. log.alert('a alert message');
  15. log.emergency('a emergency message');