Created
October 11, 2011 17:43
-
-
Save youurayy/1278817 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('winston/lib/winston/transports/loggly').Loggly.prototype.log = | |
function(level, msg, meta, callback) { | |
if(this.silent) | |
return callback(null, true); | |
var self = this; | |
/* | |
message = common.clone(meta || {}); | |
message.level = level; | |
message.message = msg; | |
*/ | |
var message = { | |
message: msg, | |
level: level | |
}; | |
if(meta) | |
message.meta = meta; | |
if(!this.ready) | |
this.logBuffer.push(message); | |
else if (this.ready && this.logBuffer.length > 0) { | |
this.logBuffer.push(message); | |
this.flush(); | |
} | |
else | |
this.client.log(this.inputToken, message, function () { | |
self.emit('logged'); | |
}); | |
callback(null, true); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment