-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add option to control browser log level #579
Conversation
Previously, when you used `quiet: true` or `noInfo: true` via the Node API or CLI, this only had effect on the output in the terminal (issue #109). With this PR, these settings will be respected in the browser console as well. Maybe it would be more flexible to add a separate option for this, but this would also mean more configuration. Looking for feedback on this.
78d081d
to
4e1a7ed
Compare
To test this: Add this to your
After |
e33b208
to
4e1a7ed
Compare
for(var i = 0; i < errors.length; i++) | ||
console.error(stripAnsi(errors[i])); | ||
log("error", stripAnsi(errors[i])); |
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.
These are useful errors and I want them to be reported. They are related to user’s code.
Hey, thanks for taking a look! So my problem is there’s no way to separate useful output (compilation warnings and errors) from useless output (generally anything prefixed with My guess is there’s some bug causing repeated disconnects. It just isn’t right that it keeps retrying and spamming the console IMO. |
This option can be `error`, `warning`, `info` or `none`. It defaults to `info`. It controls the log messages shown in the browser.
quiet
and noInfo
setting in browser console
@gaearon, I've updated the PR with your feedback.
|
4dc2ced
to
0d876f1
Compare
Thanks for taking the time to work on this.
Is this useful? Can we make it reconnect three times and give up? Or reconnect with exponential backoff? |
If your PC gets into sleep mode, and a tab with the dev-server is still open, the connection would not be restored when you get out of sleep mode. We should be able to do something smarter with it, so I've made #584 for this. It's a bit outside the scope of this PR. Do you think the rest of this PR is good? |
Yep, thanks. |
The only issue is we’re still on 1.x and can’t jump to 2.x until it’s stable. |
@SpaceK33z It will be very nice if this option can control HMR output also. |
If I understand correctly, as @farwayer said the HMR output is still logged regardless, so we're still getting some unhelpful spam (which, in my case, is annoying because our front end tests get spammed with it constantly). Not sure whether it's even possible for that code to use the same logger since it's in a different project, but here's the source: https://github.com/webpack/webpack/blob/master/hot/dev-server.js |
Previously, when you used
quiet: true
ornoInfo: true
via the Node API or CLI, this only had effect on the output in the terminal (issue #109).With this PR, these settings will be respected in the browser console as well.
Maybe it would be more flexible to add a separate option for this, but this would also mean more configuration. Looking for feedback on this.