Skip to content

Instantly share code, notes, and snippets.

@andrejewski
Created September 29, 2018 03:36
Show Gist options
  • Save andrejewski/b7119795f70c208002d4765454c083b5 to your computer and use it in GitHub Desktop.
Save andrejewski/b7119795f70c208002d4765454c083b5 to your computer and use it in GitHub Desktop.
A good logger
exports.createLogger = function createLogger (write, values = []) {
return {
log: value => write([...values, value]),
withContext: value => createLogger(write, [...values, value])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment