Documentation ¶
Index ¶
- type ContextExtractor
- type Logger
- func (l *Logger) Debug(msg string, fields ...map[string]interface{})
- func (l *Logger) Error(msg string, fields ...map[string]interface{})
- func (l *Logger) Info(msg string, fields ...map[string]interface{})
- func (l *Logger) Trace(msg string, fields ...map[string]interface{})
- func (l *Logger) Warn(msg string, fields ...map[string]interface{})
- func (l *Logger) WithContext(ctx context.Context) cloudinfo.Logger
- func (l *Logger) WithFields(fields map[string]interface{}) cloudinfo.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextExtractor ¶
type ContextExtractor interface { // Extract extracts log fields from a context. Extract(ctx context.Context) map[string]interface{} }
ContextExtractor extracts log fields from a context.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger wraps a logur logger and exposes it under a custom interface.
func NewContextAwareLogger ¶
func NewContextAwareLogger(logger logur.Logger, ctxExtractor ContextExtractor) *Logger
NewContextAwareLogger returns a new Logger instance that can extract information from a context.
func NewNoopLogger ¶
func NewNoopLogger() *Logger
NewNoopLogger returns a logger that discards all received log events.
func (*Logger) WithContext ¶
WithContext annotates a logger with a context.
Click to show internal directories.
Click to hide internal directories.