Documentation
¶
Index ¶
- Variables
- func Debug(ctx context.Context, v ...interface{})
- func DebugErr(ctx context.Context, err error, v ...interface{})
- func DebugErrf(ctx context.Context, err error, format string, v ...interface{})
- func Debugf(ctx context.Context, format string, v ...interface{})
- func Error(ctx context.Context, v ...interface{})
- func ErrorErr(ctx context.Context, err error, v ...interface{})
- func ErrorErrf(ctx context.Context, err error, format string, v ...interface{})
- func Errorf(ctx context.Context, format string, v ...interface{})
- func Fatal(ctx context.Context, v ...interface{})
- func FatalErr(ctx context.Context, err error, v ...interface{})
- func FatalErrf(ctx context.Context, err error, format string, v ...interface{})
- func Fatalf(ctx context.Context, format string, v ...interface{})
- func Info(ctx context.Context, v ...interface{})
- func InfoErr(ctx context.Context, err error, v ...interface{})
- func InfoErrf(ctx context.Context, err error, format string, v ...interface{})
- func Infof(ctx context.Context, format string, v ...interface{})
- func SetupNoLoggerForTesting()
- func Trace(ctx context.Context, v ...interface{})
- func TraceErr(ctx context.Context, err error, v ...interface{})
- func TraceErrf(ctx context.Context, err error, format string, v ...interface{})
- func Tracef(ctx context.Context, format string, v ...interface{})
- func Warn(ctx context.Context, v ...interface{})
- func WarnErr(ctx context.Context, err error, v ...interface{})
- func WarnErrf(ctx context.Context, err error, format string, v ...interface{})
- func Warnf(ctx context.Context, format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
var CtxHasLogger auloggingapi.CtxHasLoggerFunc = defaultCtxHasLogger
CtxHasLogger lets you set up a function that checks whether a context contains a logger.
var DefaultRequestIdValue = ""
DefaultRequestIdValue lets you override the default value for the request id.
This is useful for console logging if you want your request ids to align.
noinspection GoUnusedGlobalVariable
var LogEventCallback auloggingapi.LogEventCallbackFunc
LogEventCallback lets you set up a callback that is called for every log event about to be written
noinspection GoUnusedGlobalVariable
var Logger auloggingapi.LoggingImplementation
Logger is the singleton instance of ContextAwareLoggingImplementation for use by any library and application to access the logger.
See convenience.go for some examples of how to emit log entries.
This global singleton is assigned outside this module. This is so the application author can choose which logging library to use.
Library authors: only depend on go-autumn-logging and do not touch this variable.
Application authors: depend on go-autumn-logging-zerolog (or some other variant) which will set this variable on startup, and then you'll be using zerolog.
var RequestIdRetriever auloggingapi.RequestIdRetrieverFunc
RequestIdRetriever is a singleton instance for use by implementations to obtain a tracing request id from a context.
This global singleton is assigned outside this module. Assigning it is optional. If an assignment is made, such as by some of the go-autumn tracing implementations, then request ids will show up in logs for loggers that support it.
Library authors: only depend on go-autumn-logging and do not touch this variable.
Application authors: either assign this yourself, or depend on one of the tracing modules.
noinspection GoUnusedGlobalVariable
Functions ¶
func SetupNoLoggerForTesting ¶
func SetupNoLoggerForTesting()
SetupNoLoggerForTesting is a setup function to use in tests that injects a do-nothing logger.
You will need this if you are writing a library.
see convenience_test.go for an example how to use this.
Types ¶
This section is empty.