Python bindings: Control logging the Rust from the Python logging API
Categories
(Data Platform and Tools :: Glean: SDK, defect, P3)
Tracking
(Not tracked)
People
(Reporter: mdroettboom, Unassigned)
Details
(Whiteboard: [telemetry:glean-rs:m13][glean-py])
Attachments
(1 file)
There is an FFI API glean_enable_logging
to control logging from the Rust code. We should make this available through the Python logging API so it feels "Pythonic".
Reporter | ||
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Hey Mike,
what's the current behaviour? Do we get any logging from Rust when using Python bindings?
Reporter | ||
Comment 2•5 years ago
|
||
The current behavior (as of commit c3f5a16ded1711a552576fcb1cbc50cb8c67be73) is to always display all log message from Rust.
The purpose of this bug would be to make it controllable from Python using the standard APIs that a Python programmer would expect.
Comment 3•5 years ago
•
|
||
(In reply to Michael Droettboom [:mdroettboom] from comment #2)
The current behavior (as of commit c3f5a16ded1711a552576fcb1cbc50cb8c67be73) is to always display all log message from Rust.
It still requires to set the RUST_LOG
variable!
Updated•5 years ago
|
Reporter | ||
Comment 4•5 years ago
|
||
I haven't been able to get to the bottom of why, but something is turning the logging on during Python unit testing (which is probably ok, actually, but surprising). I can't reproduce it directly outside of unit testing.
$ PYTEST_ARGS=-s make test-python
=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.7.0, pytest-4.3.0, py-1.8.0, pluggy-0.13.1
rootdir: /home/mdboom/Work/builds/glean/glean.rs/glean-core/python, inifile:
plugins: localserver-0.5.0
collected 64 items
glean-core/python/tests/test_dispatcher.py ...
glean-core/python/tests/test_glean.py .......s...s.[2020-01-02T20:26:07Z ERROR glean_core] Duplicate ping named 'store1'
.[2020-01-02T20:26:07Z ERROR glean_core] Duplicate ping named 'store1'
[2020-01-02T20:26:07Z ERROR glean_core] Duplicate ping named 'store1'
.[2020-01-02T20:26:07Z ERROR glean_core] Duplicate ping named 'store1'
.sss[2020-01-02T20:26:07Z ERROR glean_core] Duplicate ping named 'store1'
.[2020-01-02T20:26:08Z ERROR glean_core] Duplicate ping named 'store1'
.[2020-01-02T20:26:08Z ERROR glean_core] Duplicate ping named 'store1'
[2020-01-02T20:26:08Z ERROR glean_core] Duplicate ping named 'store1'
.[2020-01-02T20:26:08Z ERROR glean_core] Duplicate ping named 'store1'
[2020-01-02T20:26:08Z ERROR glean_core] Duplicate ping named 'store1'
.[2020-01-02T20:26:08Z ERROR glean_core] Duplicate ping named 'store1'
[2020-01-02T20:26:08Z ERROR glean_core] Duplicate ping named 'store1'
[2020-01-02T20:26:08Z ERROR glean_core] Duplicate ping named 'store1'
[2020-01-02T20:26:08Z ERROR glean_core] Duplicate ping named 'store1'
.[2020-01-02T20:26:08Z ERROR glean_core] Duplicate ping named 'store1'
[2020-01-02T20:26:08Z ERROR glean_core] Duplicate ping named 'store1'
.
glean-core/python/tests/test_loader.py [2020-01-02T20:26:09Z ERROR glean_core] Duplicate ping named 'store1'
[2020-01-02T20:26:09Z ERROR glean_core] Duplicate ping named 'store1'
.[2020-01-02T20:26:09Z ERROR glean_core] Duplicate ping named 'store1'
[2020-01-02T20:26:09Z ERROR glean_core] Duplicate ping named 'store1'
Comment 5•5 years ago
|
||
I think the log level error
is enabled by default? Let me test.
Comment 6•5 years ago
|
||
Reporter | ||
Updated•5 years ago
|
Description
•