UI.Tee (fnord v0.9.29)

View Source

Optional 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

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(path)

@spec start_link(Path.t()) :: GenServer.on_start()

stop()

@spec stop() :: :ok

Flush and close the tee file, then stop the GenServer.

strip_ansi(data)

@spec strip_ansi(Owl.Data.t() | iodata()) :: binary()

write(data)

@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.