Browse files

[api] execute log callback on response.

  • Loading branch information...
1 parent 0993ea5 commit 31c7107124509a080ac0c905557191c2cd6c826a @chjj chjj committed May 10, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/winston-nssocket.js
View
6 lib/winston-nssocket.js
@@ -84,11 +84,15 @@ NsSocket.prototype.log = function (level, msg, meta, callback) {
message: msg
}, function (err) {
if (err) {
+ if (callback) callback(err);
return self.emit('error', err);
}
- self.emit('logged');
if (callback) callback(null, true);
+
+ // TODO: emit 'logged' correctly,
+ // keep trap of pending logs.
+ self.emit('logged');
});
};

0 comments on commit 31c7107

Please sign in to comment.