Closed
Bug 1449306
Opened 7 years ago
Closed 7 years ago
Stop using println! for debug logging
Categories
(Core :: Graphics: WebRender, enhancement, P2)
Core
Graphics: WebRender
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: Gankra, Assigned: Gankra)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
kats
:
review+
|
Details | Diff | Splinter Review |
User machines seem to sometimes get in a state where stdout isn't writeable, and println! will panic if it can't actually print, crashing the browser. Since we only use println! for debug logging, it should be fine to just continue the program if println fails.
It should be fairly easy to make a debugln! macro which is a copy of println! that simply suppresses its result.
Assignee | ||
Comment 1•7 years ago
|
||
Ah actually webrender already has log/env_logger all setup. We should just use it everywhere: https://github.com/servo/webrender/blob/master/webrender/src/device.rs#L769
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → a.beingessner
Assignee | ||
Updated•7 years ago
|
Priority: -- → P2
Updated•7 years ago
|
Blocks: stage-wr-nightly
Assignee | ||
Comment 2•7 years ago
|
||
Some upstream work for this: https://github.com/servo/webrender/pull/2648
Assignee | ||
Comment 3•7 years ago
|
||
Not 100% confident in the log levels I chose, nor if this actually just works without me doing anything else. Non-trivial review appreciated :D
Attachment #8967454 -
Flags: review?(bugmail)
Comment 4•7 years ago
|
||
Comment on attachment 8967454 [details] [diff] [review]
Bug 1434630 - use proper logging framework instead of println.
Review of attachment 8967454 [details] [diff] [review]:
-----------------------------------------------------------------
Looks ok. The default level is controlled from https://searchfox.org/mozilla-central/rev/4114ad2cfcbc511705c7865a4a34741812f9a2a9/gfx/webrender_bindings/WebRenderAPI.cpp#253 - I think we might want to change that to info or warn by default. I'm not too sure how much spew it will generate but until we ship webrender getting more output by default is probably useful. We could even increase the level on debug builds by #ifdef DEBUG
::: gfx/webrender_bindings/src/bindings.rs
@@ +753,2 @@
> let version = gl.get_string(gl::VERSION);
> + debug!("WebRender - OpenGL version new {}", version);
I think this one should be info instead of debug
Attachment #8967454 -
Flags: review?(bugmail) → review+
Comment hidden (typo) |
Comment hidden (typo) |
Assignee | ||
Comment 7•7 years ago
|
||
changed debug! to info!
Attachment #8967454 -
Attachment is obsolete: true
Attachment #8967576 -
Flags: review?(bugmail)
Comment 8•7 years ago
|
||
Comment on attachment 8967576 [details] [diff] [review]
Bug 1434630 - use proper logging framework instead of println.
Review of attachment 8967576 [details] [diff] [review]:
-----------------------------------------------------------------
A commit message would be good too
Attachment #8967576 -
Flags: review?(bugmail) → review+
Assignee | ||
Comment 9•7 years ago
|
||
commit message added
Attachment #8967576 -
Attachment is obsolete: true
Attachment #8967742 -
Flags: review?(bugmail)
Updated•7 years ago
|
Attachment #8967742 -
Flags: review?(bugmail) → review+
Comment 10•7 years ago
|
||
The patch had the bug number as 1434630. Which is not this bug, but basically the same thing. Since mc-merge will close that bug I'm going to close this one now.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Target Milestone: --- → mozilla61
You need to log in
before you can comment on or make changes to this bug.
Description
•