Skip to content

python: Use Python's logging through pyo3_log#319

Merged
geonnave merged 3 commits intolake-rs:mainfrom
chrysn-pull-requests:log-to-python
Nov 21, 2024
Merged

python: Use Python's logging through pyo3_log#319
geonnave merged 3 commits intolake-rs:mainfrom
chrysn-pull-requests:log-to-python

Conversation

@chrysn
Copy link
Copy Markdown
Member

@chrysn chrysn commented Nov 3, 2024

This makes logging accessible and configurable through Python.

@chrysn
Copy link
Copy Markdown
Member 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
Copy Markdown
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
Copy Markdown
Member Author

chrysn commented Nov 5, 2024

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

@chrysn
Copy link
Copy Markdown
Member 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
Copy Markdown
Collaborator

Thanks for this PR! Merging

@geonnave geonnave merged commit b5ab5bd into lake-rs:main Nov 21, 2024
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants