Skip to content

Support changing log levels and setting them in Python#982

Merged
paraseba merged 1 commit intomainfrom
push-yrkpuzwotzqk
Jun 12, 2025
Merged

Support changing log levels and setting them in Python#982
paraseba merged 1 commit intomainfrom
push-yrkpuzwotzqk

Conversation

@paraseba
Copy link
Copy Markdown
Collaborator

This introduces a new function icechunk.set_logs_filter(str) that allows setting and changing the logs Icechunk will produce.

On module import, we still initialize logs to the value of ICECHUNK_LOG environment variable (or error level if not present).

This introduces a new function `icechunk.set_logs_filter(str)` that
allows setting and changing the logs Icechunk will produce.

On module import, we still initialize logs to the value of ICECHUNK_LOG
environment variable (or error level if not present).
@paraseba paraseba requested review from dcherian and mpiannucci June 11, 2025 20:29
Comment thread icechunk/src/lib.rs
pub fn initialize_tracing() {
#[allow(clippy::type_complexity)]
static LOG_FILTER: std::sync::LazyLock<
std::sync::Mutex<
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

@paraseba paraseba merged commit d8bebbc into main Jun 12, 2025
11 checks passed
@paraseba paraseba deleted the push-yrkpuzwotzqk branch June 12, 2025 00:45
let os = py.import("os")?;
let environ = os.getattr("environ")?;
let environ: &Bound<PyMapping> = environ.downcast()?;
let value = environ.get_item("ICECHUNK_LOG").ok().and_then(|v| v.extract().ok());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hahahah 🤯

dcherian pushed a commit that referenced this pull request Jun 12, 2025
This introduces a new function `icechunk.set_logs_filter(str)` that
allows setting and changing the logs Icechunk will produce.

On module import, we still initialize logs to the value of ICECHUNK_LOG
environment variable (or error level if not present).
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.

3 participants