Skip to main content

Module logging

Module logging 

Source
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§

LevelFilter
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 secret to 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. None when none did since the last call.