Skip to main content

Module log

Module log 

Source
Expand description

Controls for llama.cpp’s own logger — the output the C++ library produces, which is separate from anything this crate emits through tracing.

Every one of these is documented upstream as not thread-safe; call them during setup, before inference starts.

For redirecting llama.cpp’s output into a Rust logger instead, use log_set, which installs a callback.

Functions§

pause
Pause the logger’s worker thread. Records emitted while paused are dropped, which is how upstream keeps progress bars readable.
resume
Resume after pause.
set_colors
Colourise output. Disabling is what you want when the destination is not a terminal.
set_file
Write to path, or pass None to stop writing to a file.
set_jsonl
Emit one JSON object per record instead of human-readable text — for shipping llama.cpp’s own logs into a structured pipeline.
set_prefix
Include the level prefix on each record.
set_timestamps
Include timestamps in the log prefix.
set_verbosity
Drop log records below this verbosity.
verbosity_for_level
The verbosity threshold configured for a ggml_log_level.