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

Only use console.log & console.error #177

Merged
merged 1 commit into from
Jan 9, 2018

Conversation

hsablonniere
Copy link
Member

This fixes remove usage of console.debug and console.warn to use console.log for everything except for errors (where we use console.error).

I also took the liberty to refactor some sutffs:

  • Add use_strict
  • Use some ES6+ goodies like spread, const or arrow functions
  • Remove bind calls since console is a namespace like Math or JSON

More infos on the "autobind" behaviour:

FYI, it works on Chrome, Node, Safari, FF but not yet in Edge.

Fixes #134.

This commit also contains a refactor which relies on the fact that console.* methods are "autobinded".
}, module.exports);
const fields = _.map(error.fields, (msg, field) => `${field}: ${msg}`)
return [`${error.message} [${error.id}]`, ...fields].join('\n')
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's way cleaner indeed 👍

@divarvel
Copy link
Contributor

divarvel commented Jan 9, 2018

Waiting for CI to pass and I'm merging it.

@divarvel divarvel merged commit 62902c0 into master Jan 9, 2018
@divarvel divarvel deleted the issue-134-only-use-console-log-and-error branch January 9, 2018 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

console.debug eats logging output in node 8
2 participants