Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: Use Python's logging through pyo3_log #319

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

chrysn
Copy link
Collaborator

@chrysn chrysn commented Nov 3, 2024

This makes logging accessible and configurable through Python.

@chrysn
Copy link
Collaborator Author

chrysn commented Nov 3, 2024

I've used this a lot with own added info messages; the trace messages emitted by lakers itself are not visible in this unless we touch one more knob -- might make sense to turn that on by default, because nothing we do is performance critical on the Python side.

@geonnave
Copy link
Collaborator

geonnave commented Nov 3, 2024

Cool! Suggested a comment just for clarity.

Could you enable that knob so that we don't lose the from-Rust log functionality that we currently have? Is it possible to have it controlled by an env var like with env_logger?

@chrysn
Copy link
Collaborator Author

chrysn commented Nov 5, 2024

I'll add some API expositure and some basicConfig reference.

@chrysn
Copy link
Collaborator Author

chrysn commented Nov 6, 2024

I misunderstood how this can be configured – more API won't do us any good. Instead, given that we're not logging a whole lot, and are not performance critical in Python, I've changed the code to unconditionally log trace from Rust. (This is still not super slow, as all pyo3_log's caching etc is still in). There are module level docs now that explain the logging isutation.

@geonnave
Copy link
Collaborator

Thanks for this PR! Merging

@geonnave geonnave merged commit b5ab5bd into openwsn-berkeley:main Nov 21, 2024
37 checks passed
@chrysn chrysn deleted the log-to-python branch November 25, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants