LlamaLog class final

Control over llama.cpp / ggml log output.

llama.cpp logs unconditionally to stderr by default. silence mutes the log callback; useDefault restores it; captureToFile redirects the process-wide stderr FILE* to a file so the host app can read llama.cpp / ggml log lines (which otherwise vanish on Android, where stderr is not connected to logcat).

Custom Dart-side log callbacks are intentionally not exposed: the underlying logger fires from arbitrary threads, which is unsafe for Pointer.fromFunction callbacks that touch the Dart heap. File capture is the safe, portable substitute — apps can tail the file and forward lines to logcat / debugPrint.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

captureFilePath String?
Currently active stderr-capture file path, or null if not capturing.
no setter

Static Methods

captureToFile(String path, {bool append = false}) → void
Redirect the process-wide stderr FILE* to path so llama.cpp / ggml log lines (which always go to stderr) become readable to the host app. Idempotent: a second call replaces the active capture file. Call restoreStderr to revert.
restoreStderr() → void
Undo a prior captureToFile. On POSIX this re-opens stderr against /dev/null (the original tty/pipe is not recoverable across freopen); the host app's own stderr.writeln continues to work via Dart's own fd 2, which is independent of the C FILE* slot.
silence() → void
Suppress all llama.cpp / ggml logging. Idempotent.
useDefault() → void
Restore the default behavior (logs printed to stderr by llama.cpp).