UI.Tee (fnord v0.9.29)
View SourceOptional transcript writer for --tee. When started, every UI output
(Logger messages, stdout puts, direct stderr writes) is mirrored to a
plain-text file with ANSI escape codes stripped.
When not running, write/1 is a silent no-op, so callers never need to
check whether tee mode is active.
Summary
Functions
Returns a specification to start this module under a supervisor.
Flush and close the tee file, then stop the GenServer.
Write data to the tee file, stripping ANSI codes. No-op if tee is not running. Accepts iodata - it will be flattened to a binary before stripping.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(Path.t()) :: GenServer.on_start()
@spec stop() :: :ok
Flush and close the tee file, then stop the GenServer.
@spec strip_ansi(Owl.Data.t() | iodata()) :: binary()
@spec write(iodata()) :: :ok
Write data to the tee file, stripping ANSI codes. No-op if tee is not running. Accepts iodata - it will be flattened to a binary before stripping.