-
Notifications
You must be signed in to change notification settings - Fork 251
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
feat(logger): Allow logger to be set in config #340
Conversation
70e5fde
to
a577878
Compare
Previously configuration would happen _before_ the client.logger() method could be called, so the "[bugsnag] loaded!" message would be printed before the logging could be disabled. This commit allows the logger to be set in the configuration object. Logging can be completely disabled by passing `logger: null`. Fixes #302
a577878
to
ec36873
Compare
The previous commit adding logger to the configuration increased the bundle size. This should counterbalance that added weight.
The reason the error messages can have the property name removed is because we build a message containing the key already in Line 58 in 4132b43
|
@@ -129,18 +123,6 @@ module.exports = (opts, userPlugins = []) => { | |||
: bugsnag | |||
} | |||
|
|||
const getPrefixedConsole = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only available/used inside the browser/index.js
exported function correct?
So it's removal shouldn't be a breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, it was "private" to that module. It's been moved to browser/config.js
where it is now used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Previously configuration would happen before the client.logger() method could be called, so the "[bugsnag] loaded!" message would be printed before the logging could be disabled. This commit allows the logger to be set in the configuration object. Logging can be completely disabled by passing
logger: null
.Fixes #302