Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SwappableWriter ¶ added in v0.1.5
type SwappableWriter struct {
// contains filtered or unexported fields
}
SwappableWriter is an io.Writer that can be redirected to a different target at runtime without re-wiring the slog handler. The daemon installs one as the slog sink at startup; the launcher redirects it to a tempfile while the in-process TUI owns the terminal, then restores it on exit so headless mode keeps stderr.
func NewSwappableWriter ¶ added in v0.1.5
func NewSwappableWriter(w io.Writer) *SwappableWriter
NewSwappableWriter returns a SwappableWriter pointed at w.
func NewWithSwap ¶ added in v0.1.5
func NewWithSwap(level, format string) (*slog.Logger, *SwappableWriter)
NewWithSwap is the variant used by main: it returns both the slog Logger and the SwappableWriter behind its handler, so the launcher can redirect stderr while the TUI runs.
func (*SwappableWriter) Redirect ¶ added in v0.1.5
func (s *SwappableWriter) Redirect(w io.Writer)
Redirect replaces the active target. The previous target is remembered so Restore can reinstate it.
func (*SwappableWriter) Restore ¶ added in v0.1.5
func (s *SwappableWriter) Restore()
Restore reverts to the writer that was active before the most recent Redirect. No-op when nothing was saved.