Documentation
¶
Overview ¶
Package log is the logging seam: the CLI wants progress on stdout, the API wants the same events captured per job and streamed to a browser, so the orchestrator writes to a Sink and each consumer passes its own.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
OnEvent func(Event)
// contains filtered or unexported fields
}
Buffer keeps every event and notifies a callback. What the API uses: the job holds the buffer so a browser attaching late still gets the whole history, then live updates.
Owner: the job that created it. The mutex guards Events against the SSE reader that snapshots it while the job goroutine appends; OnEvent is called OUTSIDE the mutex (rule 14).
type Console ¶
type Console struct{}
Console writes to stdout (errors to stderr). What the CLI uses.
type Event ¶
type Event struct {
// Seq is monotonic within a sink; useful for resuming an SSE stream.
Seq int64 `json:"seq"`
At int64 `json:"at"`
Level Level `json:"level"`
Message string `json:"message"`
}
Event is one log line. JSON shape matches the SSE frame the UI reads.