log

package
v3.85.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 9

Documentation

Index

Constants

View Source
const (
	IntType      = kv.IntType
	Int64Type    = kv.Int64Type
	StringType   = kv.StringType
	BoolType     = kv.BoolType
	DurationType = kv.DurationType
	StringsType  = kv.StringsType
	ErrorType    = kv.ErrorType
	AnyType      = kv.AnyType
	StringerType = kv.StringerType
)
View Source
const (
	TRACE = Level(iota)
	DEBUG
	INFO
	WARN
	ERROR
	FATAL

	QUIET
)

Variables

This section is empty.

Functions

func Coordination added in v3.10.0

func Coordination(l Logger, d trace.Detailer, opts ...Option) (t trace.Coordination)

Coordination makes trace.Coordination with logging events from details

func DatabaseSQL added in v3.34.0

func DatabaseSQL(l Logger, d trace.Detailer, opts ...Option) (t trace.DatabaseSQL)

DatabaseSQL makes trace.DatabaseSQL with logging events from details

func Default added in v3.46.0

func Default(w io.Writer, opts ...simpleLoggerOption) *defaultLogger

func Discovery added in v3.10.0

func Discovery(l Logger, d trace.Detailer, opts ...Option) (t trace.Discovery)

Discovery makes trace.Discovery with logging events from details

func Driver

func Driver(l Logger, d trace.Detailer, opts ...Option) (t trace.Driver)

Driver makes trace.Driver with logging events from details

func NamesFromContext added in v3.46.0

func NamesFromContext(ctx context.Context) []string

func Query added in v3.57.1

func Query(l Logger, d trace.Detailer, opts ...Option) (t trace.Query)

Query makes trace.Query with logging events from details

func Ratelimiter added in v3.10.0

func Ratelimiter(l Logger, d trace.Detailer, opts ...Option) (t trace.Ratelimiter)

Ratelimiter returns trace.Ratelimiter with logging events from details

func Retry added in v3.10.0

func Retry(l Logger, d trace.Detailer, opts ...Option) (t trace.Retry)

Retry returns trace.Retry with logging events from details

func Scheme added in v3.10.0

func Scheme(l Logger, d trace.Detailer, opts ...Option) (t trace.Scheme)

Scheme returns trace.Scheme with logging events from details

func Scripting added in v3.10.0

func Scripting(l Logger, d trace.Detailer, opts ...Option) (t trace.Scripting)

Scripting returns trace.Scripting with logging events from details

func Table

func Table(l Logger, d trace.Detailer, opts ...Option) (t trace.Table)

Table makes trace.Table with logging events from details

func Topic added in v3.34.0

func Topic(l Logger, d trace.Detailer, opts ...Option) (t trace.Topic)

Topic returns trace.Topic with logging events from details

func WithColoring added in v3.46.0

func WithColoring() simpleLoggerOption

func WithLevel added in v3.46.0

func WithLevel(ctx context.Context, lvl Level) context.Context

func WithLogQuery added in v3.35.0

func WithLogQuery() logQueryOption

func WithMinLevel added in v3.46.0

func WithMinLevel(level Level) simpleLoggerOption

func WithNames added in v3.46.0

func WithNames(ctx context.Context, names ...string) context.Context

Types

type Field added in v3.46.0

type Field = kv.KeyValue

type Level added in v3.15.0

type Level int

func FromString added in v3.15.0

func FromString(l string) Level

func LevelFromContext added in v3.46.0

func LevelFromContext(ctx context.Context) Level

func (Level) BoldColor added in v3.46.0

func (l Level) BoldColor() string

func (Level) Color added in v3.46.0

func (l Level) Color() string

func (Level) String added in v3.46.0

func (l Level) String() string

type Logger

type Logger interface {
	// Log logs the message with specified options and fields.
	// Implementations must not in any way use slice of fields after Log returns.
	Log(ctx context.Context, msg string, fields ...Field)
}

type Mapper added in v3.46.0

type Mapper interface {
	MapLogLevel(level Level) Level
}

type Option added in v3.46.0

type Option interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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