logging

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggerConfig

type LoggerConfig struct {
	Logger LoggerCustom
	Ctx    context.Context
}

func SetLogConfig

func SetLogConfig(options []LoggingOption) LoggerConfig

type LoggerCustom

type LoggerCustom interface {
	Info(ctx context.Context, msg string, args ...any)
	Debug(ctx context.Context, msg string, args ...any)
	Error(ctx context.Context, msg string, args ...any)
}

type LoggingOption

type LoggingOption func(*LoggerConfig)

func WithContext

func WithContext(ctx context.Context) LoggingOption

func WithLogger

func WithLogger(logger LoggerCustom) LoggingOption

type SlogLogger

type SlogLogger struct {
	// contains filtered or unexported fields
}

func NewSlogLogger

func NewSlogLogger() *SlogLogger

func (*SlogLogger) Debug

func (l *SlogLogger) Debug(ctx context.Context, msg string, args ...any)

func (*SlogLogger) Error

func (l *SlogLogger) Error(ctx context.Context, msg string, args ...any)

func (*SlogLogger) Info

func (l *SlogLogger) Info(ctx context.Context, msg string, args ...any)

Jump to

Keyboard shortcuts

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