Documentation
¶
Overview ¶
Package logging is how the library logs: through the logger its caller put in the context, and not at all when the caller put none.
The logger is a clog one. A program wires it the way clog has it,
ctx = clog.WithLogger(ctx, clog.New(handler))
and passes that context to an unpacker, which hands it on to its decomposers in their options. The library never logs to a global logger: what a program prints is the program's to decide.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext returns the logger the caller wired into the context, and one that discards everything when there is none.
clog itself falls back to the program's default slog logger, which prints. That is right for a program and wrong for a library, whose warnings would turn up on the standard error of whatever uses it.
Types ¶
type Failures ¶
type Failures struct {
// contains filtered or unexported fields
}
Failures collects the lookups a run skipped because they failed, to report them once.
A lookup that fails does not fail an extraction: the graph is built from what is at hand and the rest is left out. Left out in silence, though, the gap has nothing to explain it, so the caller is told. One message a lookup would bury everything else when a registry is down, which is when most of them fail at once.
The zero value is ready to use, and safe to add to from several goroutines.
func (*Failures) Add ¶
Add records that the lookup of an item failed, and why. A nil error is for an item that came back with nothing and no reason given.