Documentation
¶
Overview ¶
Package debug provides namespaced debug logging inspired by npm's debug package.
Loggers are created with a namespace (e.g. "auth:token", "http:request") and write to stderr only when enabled. Enable via:
- GLEAN_DEBUG env var with glob patterns: GLEAN_DEBUG=auth:* or GLEAN_DEBUG=*
- Programmatically via Enable() (used by the --verbose flag)
When disabled, Log is a near-zero-cost no-op (single atomic bool check).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a namespaced debug logger. The zero value is a disabled no-op logger.
func New ¶
New creates a debug logger for the given namespace. The logger is enabled if GLEAN_DEBUG patterns match the namespace.
Click to show internal directories.
Click to hide internal directories.