Skip to content

log

Structs

  • ForegroundLog - Handle to the swappable foreground log surface.
  • ForegroundState - Shared, runtime-swappable destination for the foreground compact layer.

Struct

Handle to the swappable foreground log surface.

firma run uses it to redirect its foreground output into a per-run directory while the wrapped agent’s TUI owns the terminal, then restore it to stderr for teardown. In file mode (--log-file) the handle is inert: stderr is never written, so [ForegroundLog::redirect] and [ForegroundLog::restore] do nothing.

Tuple Struct: ()

Methods:

  • fn active() -> Self - Handle over a live stderr surface whose sink can be swapped.
  • fn idle() -> Self - Inert handle for file mode, where there is no foreground surface.
  • fn state(self: &Self) -> Arc<ForegroundState> - Shared state, for wiring into a tracing layer’s writer and formatter.
  • fn redirect(self: &Self, dir: &Path) - Redirect the foreground log surface to <dir>/run.log so the wrapped
  • fn restore(self: &Self) - Restore the foreground log surface to stderr.

Trait Implementations:

  • Clone
    • fn clone(self: &Self) -> ForegroundLog

Struct

Shared, runtime-swappable destination for the foreground compact layer.

Methods:

  • fn is_stderr(self: &Self) -> bool - Whether the foreground currently targets stderr (used to gate ANSI
  • fn is_disabled(self: &Self) -> bool - Whether the destination is disabled (file mode); redirect/restore do
  • fn write(self: &Self, buf: &[u8]) -> io::Result<usize> - Write one buffer to the active destination, resolved lazily so a
  • fn flush(self: &Self) -> io::Result<()> - Flush the active destination.