Skip to content

Commit 1a1ce26

Browse files
author
Martin Hunt
committed
add backwards-compatible .out/.err to logger objects
1 parent a460d98 commit 1a1ce26

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/util/logging.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,22 @@ exports.Logger = Class(Writable, function () {
151151
this.toString = function() {
152152
return this._buffer.join("\n");
153153
};
154+
155+
// deprecated
156+
// backwards-compatible logging API
157+
Object.defineProperty(this, 'out', {
158+
'get': function () {
159+
return this.log.bind(this);
160+
}
161+
});
162+
163+
// deprecated
164+
// backwards-compatible logging API
165+
Object.defineProperty(this, 'err', {
166+
'get': function () {
167+
return this.error.bind(this);
168+
}
169+
});
154170
});
155171

156172
exports.getPrefix = function (tag) {

0 commit comments

Comments
 (0)