telemetry

package
v0.0.0-...-42bc384 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSlogLogger

func NewSlogLogger(logLevelStr, logType string) *slog.Logger

NOTE: this is only needed when setting the default logger using the

slog.SetDefault method.

Types

type Logger

type Logger interface {
	Fatal(format string, args ...any)
	Error(format string, args ...any)
	Info(format string, args ...any)
	Debug(format string, args ...any)
	Warn(format string, args ...any)
	With(args ...any) *slog.Logger
}

type LoggingConfig

type LoggingConfig struct {
	Level string `enum:"debug,info,warn,error" default:"info"`
	Type  string `enum:"json,console" default:"console"`
}

type SlogLogger

type SlogLogger struct {
	*slog.Logger
}

func NewLogger

func NewLogger(logLevelStr, logType string) *SlogLogger

func (*SlogLogger) Fatal

func (l *SlogLogger) Fatal(s string, args ...any)

NOTE: Use with caution. It's not advisable to use Fatal as its similar to panic

func (*SlogLogger) Log

func (l *SlogLogger) Log(ctx context.Context, level tracelog.LogLevel, msg string, data map[string]interface{})

Jump to

Keyboard shortcuts

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