Documentation
¶
Overview ¶
Package logger provides the component-prefixed debug output that the client, engine, source, and store layers write when debugging is enabled.
A Logger writes to the sink it was given and nowhere else. There is no package-level destination: every component takes a sink from whoever constructed it, so two clients in one process can log to different places, or one can log while the other stays silent. A nil *Logger, and a logger bound to a nil writer, both discard — which lets a caller with no sink to offer pass one through unconditionally instead of branching (RFC 0022 §8).
Index ¶
Constants ¶
const ( ColorBold = "\033[1m" ColorDim = "\033[2m" ColorRed = "\033[31m" ColorGreen = "\033[32m" ColorYellow = "\033[33m" ColorCyan = "\033[36m" ColorReset = "\033[0m" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger allows component-specific prefixing for debug messages.
func New ¶
New returns a Logger with the specified component name and color, and no sink — it discards until one is bound with To.
Use it for a package-level default that declares a component's prefix and colour once, then bind a sink with To at each construction site.