Skip to content

Instantly share code, notes, and snippets.

@clintandrewhall
Created September 11, 2011 23:16
Show Gist options
  • Save clintandrewhall/1210263 to your computer and use it in GitHub Desktop.
Save clintandrewhall/1210263 to your computer and use it in GitHub Desktop.
Winston configuration...?
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);
}
@indexzero
Copy link

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.

@clintandrewhall
Copy link
Author

clintandrewhall commented Sep 11, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment