You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support changing log levels and setting them in Python (#982)
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).
Copy file name to clipboardExpand all lines: docs/docs/icechunk-python/faq.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,3 +7,12 @@ Icechunk is different from normal Zarr stores because it is stateful. In a distr
7
7
**Does `icechunk-python` include logging?**
8
8
9
9
Yes! Set the environment variable `ICECHUNK_LOG=icechunk=debug` to print debug logs to stdout. Available "levels" in order of increasing verbosity are `error`, `warn`, `info`, `debug`, `trace`. The default level is `error`. The Rust library uses `tracing-subscriber` crate. The `ICECHUNK_LOG` variable can be used to filter logging following that crate's [documentation](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#directives). For example, `ICECHUNK_LOG=trace` will set both icechunk and it's dependencies' log levels to `trace` while `ICECHUNK_LOG=icechunk=trace` will enable the `trace` level for icechunk only. For more complex control `ICECHUNK_LOG=debug,icechunk=trace,rustls=info,h2=info,hyper=info` will set `trace` for `icechunk`, `info` for `rustls`,`hyper`, and `h2` crates, and `debug` for every other crate.
10
+
11
+
You can also use Python's `os.environ` to set or change the value of the variable. If you change the environment variable after `icechunk` was
12
+
imported, you will need to call `icechunk.set_logs_filter(None)` for changes to take effect.
13
+
14
+
This function also accepts the filter directive. If you prefer not to use environment variables, you can do:
0 commit comments