Documentation ¶
Overview ¶
Package logging provides loggers for Kopia.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContextLoggerFunc ¶
GetContextLoggerFunc returns an function that returns a logger for a given module when provided with a context.
func SetDefault ¶
func SetDefault(l LoggerForModuleFunc)
SetDefault sets the logger to use when context-specific logger is not set.
func WithLogger ¶
func WithLogger(ctx context.Context, l LoggerForModuleFunc) context.Context
WithLogger returns a derived context with associated logger.
Types ¶
type Logger ¶
type Logger interface { Debugf(msg string, args ...interface{}) Infof(msg string, args ...interface{}) Warningf(msg string, args ...interface{}) Errorf(msg string, args ...interface{}) Fatalf(msg string, args ...interface{}) }
Logger is an interface used by Kopia to output logs.
type LoggerForModuleFunc ¶
LoggerForModuleFunc retrieves logger for a given module.
func Printf ¶
func Printf(printf func(msg string, args ...interface{})) LoggerForModuleFunc
Printf returns LoggerForModuleFunc that uses given printf-style function to print log output.
Click to show internal directories.
Click to hide internal directories.