logger

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceIDKey   ctxKey = "trace_id"
	RequestIDKey ctxKey = "request_id"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Environment

type Environment string
const (
	EnvironmentDevelopment Environment = "development"
	EnvironmentProduction  Environment = "production"
	EnvironmentTest        Environment = "test"
	EnvironmentLocal       Environment = "local"
)

type Logger

type Logger struct {
	*log.Logger
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(environment Environment, prefix string) *Logger

func (*Logger) Debug

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

func (*Logger) Error

func (l *Logger) Error(ctx context.Context, msg string, fields map[string]any)

func (*Logger) Info

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

func (*Logger) Warn

func (l *Logger) 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