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,7 +742,7 @@ 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()
*
@ -749,13 +751,13 @@ function logEmitter(minLevel) {
* 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