Documentation ¶
Overview ¶
Package logging provides logging.
Index ¶
- type Config
- type GoLoggingLogger
- func (gll GoLoggingLogger) Critical(ctx context.Context, f string, v ...interface{})
- func (gll GoLoggingLogger) Debug(ctx context.Context, f string, v ...interface{})
- func (gll GoLoggingLogger) Error(ctx context.Context, f string, v ...interface{})
- func (gll GoLoggingLogger) Info(ctx context.Context, f string, v ...interface{})
- func (gll GoLoggingLogger) Notice(ctx context.Context, f string, v ...interface{})
- func (gll GoLoggingLogger) Warning(ctx context.Context, f string, v ...interface{})
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Name determines the name of the logger. Name string // Level determines the level of the logger. LogLevel string // Color determines whether logs are printed with color, where supported. Color bool }
Config provides a configuration for loggers.
type GoLoggingLogger ¶
type GoLoggingLogger struct {
// contains filtered or unexported fields
}
GoLoggingLogger is a Logger based on the go-logging library.
func NewGoLoggingLogger ¶
func NewGoLoggingLogger(config Config) GoLoggingLogger
NewGoLoggingLogger returns a GoLoggingLogger, given a Config.
func (GoLoggingLogger) Critical ¶
func (gll GoLoggingLogger) Critical(ctx context.Context, f string, v ...interface{})
Critical logs on the Critical level.
func (GoLoggingLogger) Debug ¶
func (gll GoLoggingLogger) Debug(ctx context.Context, f string, v ...interface{})
Debug logs on the Debug level.
func (GoLoggingLogger) Error ¶
func (gll GoLoggingLogger) Error(ctx context.Context, f string, v ...interface{})
Error logs on the Error level.
func (GoLoggingLogger) Info ¶
func (gll GoLoggingLogger) Info(ctx context.Context, f string, v ...interface{})
Info logs on the Info level.
type Logger ¶
type Logger interface { // Debug is for logging information pertinent to development and testing. Debug(ctx context.Context, f string, v ...interface{}) // Info is for logging information that is useful for users. Info(ctx context.Context, f string, v ...interface{}) // Notice is for logging information that is useful for users // that is of a higher importance than Info. Notice(ctx context.Context, f string, v ...interface{}) // Warning is for logging information that may imply that // something untoward has occurred, but that is not a hard error. Warning(ctx context.Context, f string, v ...interface{}) // Error is for logging error messages. Use this in error checking. Error(ctx context.Context, f string, v ...interface{}) // Critical should be used infrequently, and is for cases where // human intervention is required to stop catastrophic failure. // e.g: losing all units in a cluster, impending nuclear missile launch. Critical(ctx context.Context, f string, v ...interface{}) }
Logger provides an interface for other loggers to implement.
Click to show internal directories.
Click to hide internal directories.