Logging¶
mllabs.BaseLogger
¶
Bases: ABC
mllabs.DefaultLogger
¶
Bases: BaseLogger
Logger with built-in ANSI multi-session progress display.
Each session occupies one terminal line. Progress lines are redrawn in-place using ANSI cursor movement so info/warning messages scroll normally above them.
Falls back to plain printing when stdout is not a TTY (e.g. Jupyter, pipes) — in that case progress is not rendered.
Since progress rendering owns the terminal cursor (a resource shared
across the whole process), independent instances writing at the same
time will corrupt each other's output. Use :meth:get_instance to
share one process-wide instance instead of constructing directly.
get_instance(level=['info', 'warning', 'progress'], n_store_warning=1000)
classmethod
¶
Return the shared process-wide DefaultLogger, creating it on first use.
level/n_store_warning only apply to the first call that
creates the instance — later calls return the same object as-is.
mllabs.ProgressSessionLogger
¶
Bases: BaseLogger
Logger that delegates progress display to injected session objects.
Pass session_cls to control how each progress slot is rendered
(e.g. TqdmProgressSession).
mllabs.BaseProgressSession
¶
Progress display for one position. Standalone — no Logger inheritance.
mllabs.TqdmProgressSession
¶
Bases: BaseProgressSession