Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make usage of winston 3.x default #51

Closed
wants to merge 16 commits into from

Remove legacy code in log method

  • Loading branch information
Filip Elias
Filip Elias committed Jan 22, 2019
commit 8d4c8868382b5304321c571a72384add0af5cd83
@@ -113,7 +113,7 @@ const validateMetadata = (meta) => {
// #### @callback {function} Continuation to respond to when complete.
// Core logging method exposed to Winston. Metadata is optional.
//
Loggly.prototype.log = function (level, msg, meta, callback) {
Loggly.prototype.log = function (meta, callback) {

const message = validateMetadata(meta);

@@ -126,25 +126,24 @@ Loggly.prototype.log = function (level, msg, meta, callback) {
}

if (this.stripColors) {
msg = ('' + msg).replace(code, '');
message.message = ('' + message.message).replace(code, '');
}

const self = this;

message.level = level;
message.message = msg || message.message;

//
// Helper function for responded to logging.
//
function logged(err) {
self.emit('logged');
callback(err, true);
}

return (meta && meta.tags)
result = (meta && meta.tags)
? this.client.log(message, meta.tags, logged)
: this.client.log(message, logged);

callback();
return result;
};

//
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.