logger

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(ctx context.Context, msg string, fields ...zapcore.Field)

Debug logs a message at debug level

func Error

func Error(ctx context.Context, msg string, fields ...zapcore.Field)

Error logs a message at error level

func Fatal

func Fatal(ctx context.Context, msg string, fields ...zapcore.Field)

Fatal logs a message at fatal level and then calls os.Exit(1)

func GetTraceID

func GetTraceID(ctx context.Context) string

GetTraceID extracts trace ID from context

func Info

func Info(ctx context.Context, msg string, fields ...zapcore.Field)

Info logs a message at info level

func Initialize

func Initialize(config Config) error

Initialize sets up the global logger with the provided configuration

func Sync

func Sync() error

Sync flushes any buffered log entries

func Warn

func Warn(ctx context.Context, msg string, fields ...zapcore.Field)

Warn logs a message at warn level

func WithContext

func WithContext(ctx context.Context) *zap.Logger

WithContext returns a logger with context fields

Types

type Config

type Config struct {
	Level       string
	Format      string
	OutputPaths []string
}

Config represents logger configuration

Jump to

Keyboard shortcuts

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