Package logging provides logging functions for use in the bar and modules. It uses build tags to provide nop functions in the default case, and actual logging functions when built with `-tags debuglog`.
Attach attaches an object as a named member of a different object. This is useful when a generic type (e.g. chan) is used within a more specific type (e.g. Module). Typical usage would be:
logging.Attach(m, m.scheduler, "refresher")
where m is a module, m.scheduler is a timing.Scheduler. This will make subsequent log statements that use that scheduler as a context (even from a different package, e.g. timing) print it as module#1.refresher instead of timing.Scheduler#45.
Attachf is Attach with built-in formatting.
Fine logs a formatted message if fine logging is enabled for the calling module. Enable fine logging using the commandline flag, `--finelog=$module1,$module2`. [Requires debug logging].
ID returns a unique name for the given value of the form 'type'#'index' for addressable types. This provides log statements with additional context and separates logs from multiple instances of the same type.
Label adds an additional label to thing, incorporated as part of its identifier, to provide more useful information than just #0, #1, ... For example, a diskspace module might use:
which would make its ID mod:diskspace.Module#0<sda1>, making it easier to track in logs.
Labelf is Label with built-in formatting. Because all logging functions are no-ops without debuglog, having the sprintf be part of the Labelf function means that it will only be executed if debug logging is on.
Log logs a formatted message.
Register attaches the given fields of a given *struct as '.' + name. This is just a shortcut for Register(&thing, &thing.field, ".field")... for a set of fields.
SetFlags sets flags to control logging output.
SetOutput sets the output stream for logging.