Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#6187 closed defect (fixed)

Uncatchable error messages making it through to ChimeraX log

Reported by: Zach Pearson Owned by: Zach Pearson
Priority: moderate Milestone:
Component: Logging Version:
Keywords: Cc:
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

Recently while working on #6178 and attempting to present a good error message to users unable to connect to our backend, saw that third party packages are somehow able to print error messages to ChimeraX's logger (presumably, we make it so that logging.getLogger returns our log?). It would be nice if we could prevent this.

Attachments (1)

Screen Shot 2022-02-16 at 3.11.25 PM.png (100.8 KB ) - added by Zach Pearson 4 years ago.
urllib3 error coming in before our error

Download all attachments as: .zip

Change History (6)

by Zach Pearson, 4 years ago

urllib3 error coming in before our error

comment:1 by Zach Pearson, 4 years ago

Will try the advice at the bottom of https://urllib3.readthedocs.io/en/latest/user-guide.html which is to set urllib3's log level higher e.g. logging.getLogger("urllib3").setLevel(logging.WARNING)

comment:2 by Zach Pearson, 4 years ago

Owner: set to Zach Pearson
Status: newassigned

comment:3 by Zach Pearson, 4 years ago

It worked! Resolved in this commit.

comment:4 by Zach Pearson, 4 years ago

Resolution: fixed
Status: assignedclosed

comment:5 by pett, 4 years ago

FYI, it's because stderr and stdout get redirected to the logger by chimerax.ui.gui.redirect_stdio_to_logger()

Note: See TracTickets for help on using tickets.