Documentation
¶
Overview ¶
Package telelog provides a queued, ISO 8601 UTC logger for all Tela binaries.
Log lines are written to a channel and consumed by a low-priority background goroutine, minimizing the impact of logging on runtime performance. Lines are still captured in order because the channel is unbuffered reads happen in FIFO order from a buffered channel.
Usage:
telelog.Init("tela", os.Stderr) // call once at startup
log.Println("hello") // uses standard log, routed through telelog
telelog.Flush() // call before exit to drain the queue
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirectWriter ¶
DirectWriter returns an io.Writer that writes directly to the output without going through the queue. Use for the underlying output when other writers need to tee.
func Flush ¶
func Flush()
Flush blocks until all queued log lines have been written. Call before exit.
func Init ¶
Init configures the global logger to use queued, ISO 8601 UTC output. prefix is the component name (e.g., "tela", "telad", "mount"). out is the output destination (typically os.Stderr). Call this once at the start of main before any logging.
func NewLogger ¶
NewLogger creates a log.Logger with a different prefix that routes through the same queue. Use this for per-component loggers (e.g., per-machine in telad).
func SetOutput ¶
SetOutput changes the output destination for the queue drainer. Use this to redirect log output (e.g., to a tee writer that captures output for a control API while still writing to stderr).
func WrapOutput ¶
WrapOutput returns an io.Writer that tees to both the log queue and the given writer. Use this for the tela control log capture (which needs to capture output to a buffer AND route through the queue).
Types ¶
This section is empty.