Documentation ¶
Overview ¶
Package logger provides access to an implementation of v23/logger.Logging for use within a runtime implementation. There is pre-created "global" logger and the ability to create new loggers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAlreadyConfiguredError ¶
IsAlreadyConfiguredError returns true if the err parameter indicates the the logger has already been configured.
Types ¶
type ManageLog ¶
type ManageLog interface { // LogDir returns the directory where the log files are written. LogDir() string // Stats returns stats on how many lines/bytes haven been written to // this set of logs. Stats() (Info, Error struct{ Lines, Bytes int64 }) // ConfigureLoggerFromFlags will configure the supplied logger using // command line flags. ConfigureFromFlags(opts ...vlog.LoggingOpts) error // ConfigureFromArgs will configure the supplied logger using the supplied // arguments. ConfigureFromArgs(opts ...vlog.LoggingOpts) error // ExplicitlySetFlags returns a map of the logging command line flags and their // values formatted as strings. Only the flags that were explicitly set are // returned. This is intended for use when an application needs to know what // value the flags were set to, for example when creating subprocesses. ExplicitlySetFlags() map[string]string }
ManageLog defines the methods for managing and configuring a logger.
func Manager ¶
Manager determines if the supplied logging.Logger implements ManageLog and if so returns an instance of it. If it doesn't implement ManageLog then Manager will return a dummy implementation that is essentially a no-op. It is always safe to use it as: logger.Manager(logger.Global()).LogDir() for example.