Skip to content

Instantly share code, notes, and snippets.

@mahemoff
Created September 5, 2011 18:25
Show Gist options
  • Save mahemoff/1195611 to your computer and use it in GitHub Desktop.
Save mahemoff/1195611 to your computer and use it in GitHub Desktop.
logging with winston
winston = require 'winston'
global[level] = winston[level] for level of winston.config.syslog.levels
debug 'foo'
info 'foo'
notice 'foo'
warning 'foo'
error 'foo'
crit 'foo'
alert 'foo'
emerg 'foo'
winston = require('winston');
for (level in winston.config.syslog.levels) { global[level] = winston[level]; }
debug('foo');
info('foo');
notice('foo');
warning('foo');
error('foo');
crit('foo');
alert('foo');
emerg('foo');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment