minor cosmetic changes

This commit is contained in:
Trent Mick 2012-10-24 09:04:57 -07:00
parent b450b015b3
commit 590eae18bf

View file

@ -695,11 +695,12 @@ Logger.prototype._emit = function (rec) {
};
}
/**
* build a log emitter function for level minLevel.
*
* Build a log emitter function for level minLevel. I.e. this is the
* creator of `log.info`, `log.error`, etc.
*/
function logEmitter(minLevel) {
function mkLogEmitter(minLevel) {
return function () {
var fields = null, msgArgs = null;
if (arguments.length === 0) { // `log.<level>()`
@ -731,6 +732,7 @@ function logEmitter(minLevel) {
}
}
/**
* The functions below log a record at a specific level.
*
@ -740,22 +742,22 @@ function logEmitter(minLevel) {
* log.<level>(<string> msg, ...)
* log.<level>(<object> fields, <string> msg, ...)
*
* where <level> is the lowercase version of the log level. Eg:
* where <level> is the lowercase version of the log level. E.g.:
*
* log.info()
* log.info()
*
* @params fields {Object} Optional set of additional fields to log.
* @params msg {String} Log message. This can be followed by additional
* arguments that are handled like
* [util.format](http://nodejs.org/docs/latest/api/all.html#util.format).
*/
Logger.prototype.trace = mkLogEmitter(TRACE);
Logger.prototype.debug = mkLogEmitter(DEBUG);
Logger.prototype.info = mkLogEmitter(INFO);
Logger.prototype.warn = mkLogEmitter(WARN);
Logger.prototype.error = mkLogEmitter(ERROR);
Logger.prototype.fatal = mkLogEmitter(FATAL);
Logger.prototype.trace = logEmitter(TRACE);
Logger.prototype.debug = logEmitter(DEBUG);
Logger.prototype.info = logEmitter(INFO);
Logger.prototype.warn = logEmitter(WARN);
Logger.prototype.error = logEmitter(ERROR);
Logger.prototype.fatal = logEmitter(FATAL);
//---- Standard serializers