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

Allow bulk messages to be passed as an array #21

Merged
merged 1 commit into from Oct 19, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Allow bulk messages to be passed as an array

  • Loading branch information
MauriceButler committed Oct 3, 2017
commit aab4a8deff8a8c521b61074f2a3eae73063ba1c3
@@ -144,7 +144,7 @@ Loggly.prototype.log = function (msg, tags, callback) {
}
}

msg = serialize(msg);
msg = this.isBulk && Array.isArray(msg) ? msg.map(serialize) : serialize(msg);

logOptions = {
uri: this.isBulk ? this.urls.bulk : this.urls.log,
@@ -212,7 +212,13 @@ common.loggly = function () {
}
},5000);
}
arrMsg.push(requestBody);

if (Array.isArray(requestBody)) {
arrMsg.push.apply(arrMsg, requestBody);
} else {
arrMsg.push(requestBody);
}

if (arrMsg.length === arrSize) {
sendBulkLogs();
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.