Skip to content

Instantly share code, notes, and snippets.

@agnaite
Created September 13, 2017 17:49
Show Gist options
  • Save agnaite/3bbc7ef9d6e23ef4401ba2b752ddfc17 to your computer and use it in GitHub Desktop.
Save agnaite/3bbc7ef9d6e23ef4401ba2b752ddfc17 to your computer and use it in GitHub Desktop.
module.exports = (logSources, printer) => {
const entries = []
logSources.forEach(logSource => {
console.log("new log source")
let newEntry = logSource.pop()
while (newEntry) {
entries.push(newEntry)
newEntry = logSource.pop()
}
});
const sortedEntries = mergeSort(entries);
sortedEntries.forEach(entry => {
printer.print(entry)
});
printer.done();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment