Expand description
The log file, and keeping stray stderr off the screen: while the TUI runs, fd 2
points at the log, Polars warnings go through log, and non-fatal errors (cache,
history) land here.
Structs§
- FileLog
- A size-capped log file with one rotation.
- LogSettings
- Where the log goes and how much of it.
- TuiSession
- The span during which the TUI owns the terminal: stderr goes to the log (Unix), and a panic on a background thread is logged instead of printed over the screen. Dropping it, on every exit path, hands stderr back.
Enums§
- Level
Filter - An enum representing the available verbosity level filters of the logger.
Constants§
- LOG_
FILE_ NAME - The log’s name in the cache directory.
Traits§
- LogFailure
- Log a failure not worth stopping for (cache, history) instead of dropping it.
Functions§
- catch_
panic - Run
work, turning a panic into a message for the user. The hook has already logged the panic with its backtrace; the message says where. A panic on a Polars thread that this work was waiting on is resumed here, so it is reported here too. - current_
path - The file the log is writing to, if it is open.
- init
- Open the log and install the logger and Polars warning hook; repeatable (the Python
binding runs the TUI per
view), latest settings winning. Returns the message for the user if the log cannot open, unprinted since stderr may be that log. - keep_
out_ of_ log - Never write
secretto the log as it is. - next_
polars_ warning - The next Polars user warning not yet shown, for the footer.
- redact
- Mask credentials in a log line: known secret values, the user and password in a URL, signed-URL and SAS query parameters, and authorization headers.
- rotated_
path - The rotated copy of
path:datui.log→datui.log.1. - take_
unreported_ panic - What to flash when a background thread panicked with nothing to say so: a raw
thread’s result simply never arrives.
Nonewhen none did since the last call.