Created
September 11, 2011 23:16
-
-
Save clintandrewhall/1210263 to your computer and use it in GitHub Desktop.
Winston configuration...?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
"levels" : { | |
"detail": 0, | |
"trace": 1, | |
"debug": 2, | |
"enter": 3, | |
"info": 4, | |
"warning": 5, | |
"error": 6 | |
}, | |
"colors" : { | |
"detail": "grey", | |
"trace": "white", | |
"debug": "blue", | |
"enter": "inverse", | |
"info": "green", | |
"warning": "yellow", | |
"error": "red" | |
} | |
winston.cli(); | |
winston.handleExceptions(new winston.transports.File({ filename: "logs/exceptions.log" })); | |
winston.addColors(config.colors); | |
winston.setLevels(config.levels); | |
winston.info("INFO"); | |
winston.detail("DETAILS"); | |
winston.info(winston.detail); | |
I GET: | |
info: INFO. | |
info: function (msg) { | |
var args = Array.prototype.slice.call(arguments), | |
callback = typeof args[args.length - 1] === 'function' ? args.pop() : null, | |
meta = args.length === 2 ? args.pop() : null; | |
require("sys").log(args); | |
return target.log(level, msg, meta, callback); | |
} |
Thanks for the quick reply! And I'll keep this sort of thing to github... some people don't like questions in their issues list. :-)
Thanks again for the help!
…On Sep 11, 2011, at 6:24 PM, Charlie Robbins wrote:
btw, always happy to help on this sort of question, but Twitter is not my preferred method of communication for bugs and issues. In the future, just open a Github issue. I try to be quick to respond to those as well.
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/1210263
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
btw, always happy to help on this sort of question, but Twitter is not my preferred method of communication for bugs and issues. In the future, just open a Github issue. I try to be quick to respond to those as well.