Bug 8258 - Python stdlib logging bypasses ThinLinc logging settings
Summary: Python stdlib logging bypasses ThinLinc logging settings
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Other (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on: 8259
Blocks:
  Show dependency treegraph
 
Reported: 2023-11-23 09:59 CET by Adam Halim
Modified: 2023-11-28 13:10 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Adam Halim cendio 2023-11-23 09:59:57 CET
Broken out from bug 7636, but affects more things than just asyncio.

Several modules inside the Python standard library (asyncio and multiprocessing for example) use logging internally somewhat arbitrarily. This means that we currently don't have any control over how this logging gets done, such as how to format it, to which file things get logged, and which logging level should be used. Examples with further details can be seen in bug 7636 comment #32, bug 7636 comment #34, bug 7636 comment #44.

I had a very brief look and saw that the modules that *might* cause incorrect logging are:
* asyncio
* concurrent.futures
* http
* lib2to3
* multiprocessing
* site-packages (several sub packages)
* venv

From what I've seen during development, only logging from asyncio has been causing issues, but the problem is a more general one.
Comment 1 Adam Halim cendio 2023-11-23 11:30:11 CET
It seems like logging.captureWarnings(bool) [1] can be used to redirect warnings to the logging module instead. We might be able to use this to kill two birds with one stone (bug 8257).

[1] https://docs.python.org/3/library/logging.html#logging.captureWarnings

Note You need to log in before you can comment on or make changes to this bug.