logging

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterLogger

func RegisterLogger(ctx context.Context, logger Logger) context.Context

Types

type Logger

type Logger interface {
	Warn(ctx context.Context, msg string, fields ...map[string]any)
	Info(ctx context.Context, msg string, fields ...map[string]any)
	Debug(ctx context.Context, msg string, fields ...map[string]any)
	Trace(ctx context.Context, msg string, fields ...map[string]any)

	SetField(ctx context.Context, key string, value any) context.Context

	SubLogger(ctx context.Context, name string) (context.Context, Logger)
}

func RetrieveLogger

func RetrieveLogger(ctx context.Context) Logger

type NullLogger

type NullLogger struct {
}

func (NullLogger) Debug

func (l NullLogger) Debug(ctx context.Context, msg string, fields ...map[string]any)

func (NullLogger) Info

func (l NullLogger) Info(ctx context.Context, msg string, fields ...map[string]any)

func (NullLogger) SetField

func (l NullLogger) SetField(ctx context.Context, key string, value any) context.Context

func (NullLogger) SubLogger

func (l NullLogger) SubLogger(ctx context.Context, name string) (context.Context, Logger)

func (NullLogger) Trace

func (l NullLogger) Trace(ctx context.Context, msg string, fields ...map[string]any)

func (NullLogger) Warn

func (l NullLogger) Warn(ctx context.Context, msg string, fields ...map[string]any)

type TfLogger

type TfLogger string

func NewTfLogger

func NewTfLogger(ctx context.Context) (context.Context, TfLogger)

func (TfLogger) Debug

func (l TfLogger) Debug(ctx context.Context, msg string, fields ...map[string]any)

func (TfLogger) Info

func (l TfLogger) Info(ctx context.Context, msg string, fields ...map[string]any)

func (TfLogger) SetField

func (l TfLogger) SetField(ctx context.Context, key string, value any) context.Context

func (TfLogger) SubLogger

func (l TfLogger) SubLogger(ctx context.Context, name string) (context.Context, Logger)

func (TfLogger) Trace

func (l TfLogger) Trace(ctx context.Context, msg string, fields ...map[string]any)

func (TfLogger) Warn

func (l TfLogger) Warn(ctx context.Context, msg string, fields ...map[string]any)

Jump to

Keyboard shortcuts

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