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

Use winston 3.x by default #53

Merged
merged 17 commits into from Feb 12, 2019

Remove legacy code in log method

  • Loading branch information
Filip Elias
Filip Elias committed Jan 24, 2019
commit f963c2eb1ef5530969fcbb2f93504c2f8c3e69e0
@@ -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.