This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Logging in Rust code not working (in unit tests?) #14975
Labels
O-Occasional
Affects or can be seen by some users regularly or most users rarely
S-Minor
Blocks non-critical functionality, workarounds exist.
T-Defect
Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
We use pyo3-log to get Rust logs into the Python logging framework; this seems to not work properly. If you put e.g. a
warn!(...)
then it doesn't print out anywhere.We initialize the logging module in
lib.rs
:synapse/rust/src/lib.rs
Line 23 in 42d261c
And we import the synapse rust code very early in the Synapse process:
synapse/synapse/__init__.py
Line 83 in dc37b68
I think we're importing the rust code before the loggers are configured, which then causes
pyo3-log
to initialize and cache the Python logging configuration, then by the time we actually call Rust code we've reconfigured the python loggers, but that doesn't propagate into Rust.I ran into this in unittests, but I think it would happen during normal usage as well.
The text was updated successfully, but these errors were encountered: