cloudinfoadapter

package
v0.0.0-...-2215086 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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 NewLogger

func NewLogger(logger logur.Logger) *Logger

NewLogger returns a new Logger instance.

func NewNoopLogger

func NewNoopLogger() *Logger

NewNoopLogger returns a logger that discards all received log events.

func (*Logger) Debug

func (l *Logger) Debug(msg string, fields ...map[string]interface{})

Debug logs a debug event.

func (*Logger) Error

func (l *Logger) Error(msg string, fields ...map[string]interface{})

Error logs an error event.

func (*Logger) Info

func (l *Logger) Info(msg string, fields ...map[string]interface{})

Info logs an info event.

func (*Logger) Trace

func (l *Logger) Trace(msg string, fields ...map[string]interface{})

Trace logs a trace event.

func (*Logger) Warn

func (l *Logger) Warn(msg string, fields ...map[string]interface{})

Warn logs a warning event.

func (*Logger) WithContext

func (l *Logger) WithContext(ctx context.Context) cloudinfo.Logger

WithContext annotates a logger with a context.

func (*Logger) WithFields

func (l *Logger) WithFields(fields map[string]interface{}) cloudinfo.Logger

WithFields annotates a logger with key-value pairs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL