Principle:Ggml org Llama cpp Logging System
| Knowledge Sources | |
|---|---|
| Domains | Logging, Infrastructure |
| Last Updated | 2026-02-15 00:00 GMT |
Overview
The Logging System is the principle of providing structured, configurable diagnostic output across all llama.cpp components.
Description
This principle defines a centralized logging framework that provides consistent log formatting, configurable verbosity levels, and thread-safe output across the entire llama.cpp codebase. The logging system supports multiple severity levels, timestamp formatting, source location tagging, and the ability to redirect output to files or custom handlers.
Usage
Apply this principle whenever diagnostic output, error reporting, or debug information needs to be emitted from any component of llama.cpp, ensuring consistent formatting and respecting the user's configured verbosity level.
Theoretical Basis
The logging system follows a severity-based filtering model where log messages are tagged with levels (debug, info, warning, error) and filtered against a configured threshold. This allows developers to add verbose diagnostic logging without impacting production performance, as messages below the threshold are discarded early. The implementation uses thread-local or synchronized output to prevent interleaved log lines in multi-threaded inference scenarios. The header/implementation split allows the logging macros to be included everywhere with minimal compilation overhead.