minor cosmetic changes
This commit is contained in:
parent
b450b015b3
commit
590eae18bf
1 changed files with 13 additions and 11 deletions
|
@ -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 () {
|
return function () {
|
||||||
var fields = null, msgArgs = null;
|
var fields = null, msgArgs = null;
|
||||||
if (arguments.length === 0) { // `log.<level>()`
|
if (arguments.length === 0) { // `log.<level>()`
|
||||||
|
@ -731,6 +732,7 @@ function logEmitter(minLevel) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The functions below log a record at a specific level.
|
* The functions below log a record at a specific level.
|
||||||
*
|
*
|
||||||
|
@ -740,22 +742,22 @@ function logEmitter(minLevel) {
|
||||||
* log.<level>(<string> msg, ...)
|
* log.<level>(<string> msg, ...)
|
||||||
* log.<level>(<object> fields, <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 fields {Object} Optional set of additional fields to log.
|
||||||
* @params msg {String} Log message. This can be followed by additional
|
* @params msg {String} Log message. This can be followed by additional
|
||||||
* arguments that are handled like
|
* arguments that are handled like
|
||||||
* [util.format](http://nodejs.org/docs/latest/api/all.html#util.format).
|
* [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
|
//---- Standard serializers
|
||||||
|
|
Loading…
Reference in a new issue