otellogr

package module
v0.0.0-...-850d857 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: MIT Imports: 8 Imported by: 0

README

Otel Logr

Go Reference CircleCI

Implementation of the logr interface with OpenTelemetry Go

Usage

logger := otellogr.NewLogger("Tracer Name")
logger = logger.WithAttributes("my-key", "my value") // Sets attributes for all spans created afterwards with this logger

logger.Info("This is some information") // Creates and ends a span with this name
logger.Info(errors.New("An error occured"), "This is some error") // Creates and ends a span with an error Event

Documentation

Index

Constants

View Source
const (
	All int = iota
	Info
	Error
)

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(n string) logr.Logger

Types

type Logger

type Logger struct {
	Name   string
	Tracer trace.Tracer
	// contains filtered or unexported fields
}

func (Logger) Enabled

func (l Logger) Enabled() bool

func (Logger) Error

func (l Logger) Error(err error, msg string, keysAndValues ...interface{})

func (Logger) Info

func (l Logger) Info(msg string, keysAndValues ...interface{})

func (Logger) V

func (l Logger) V(level int) logr.Logger

func (Logger) WithName

func (l Logger) WithName(name string) logr.Logger

func (Logger) WithValues

func (l Logger) WithValues(kvList ...interface{}) logr.Logger

Jump to

Keyboard shortcuts

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