Browse files

[transport] File.log, use better callbacks.

  • Loading branch information...
1 parent a10ac5e commit 4953fdd55aae80ec1a503197838b9eaa87ffc3e3 @chjj chjj committed Jul 30, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/winston/transports/file.js
View
7 lib/winston/transports/file.js
@@ -118,10 +118,13 @@ File.prototype.log = function (level, msg, meta, callback) {
//
this._stream.write(output);
this._lazyDrain();
+
+ callback(null, true);
}
else {
this.open(function (err) {
if (err) {
+ callback(null, true);
//
// If there was an error enqueue the message
//
@@ -130,10 +133,10 @@ File.prototype.log = function (level, msg, meta, callback) {
self._stream.write(output);
self._lazyDrain();
+
+ callback(null, true);
});
}
-
- callback(null, true);
};
//

0 comments on commit 4953fdd

Please sign in to comment.