diff --git a/CHANGES.md b/CHANGES.md index 49f4ee7..f56bbf4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,10 @@ ## bunyan 0.6.5 (not yet released) -(nothing yet) +- Add 'level' field to log record before custom fields for that record. This just + means that the raw record JSON will show the 'level' field earlier, which is a bit + nicer for raw reading. + ## bunyan 0.6.4 diff --git a/lib/bunyan.js b/lib/bunyan.js index ebba6f4..717c17d 100644 --- a/lib/bunyan.js +++ b/lib/bunyan.js @@ -600,6 +600,7 @@ Logger.prototype._mkRecord = function (fields, level, msgArgs) { */ Logger.prototype._emit = function (rec) { var obj = objCopy(rec[0]); + var level = obj.level = rec[2]; var recFields = rec[1]; if (recFields) { if (this.serializers) { @@ -609,7 +610,6 @@ Logger.prototype._emit = function (rec) { obj[k] = recFields[k]; }); } - var level = obj.level = rec[2]; xxx("Record:", rec) obj.msg = format.apply(this, rec[3]); if (!obj.time) {