logger

package
v0.0.0-...-0299622 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Key   string
	Value interface{}
}

Field represents a structured log field

func Any

func Any(key string, value interface{}) Field

Any creates a new Field

type Level

type Level int

Level defines the log level

const (
	DebugLevel Level = iota
	InfoLevel
	WarnLevel
	ErrorLevel
	FatalLevel
)

type Logger

type Logger interface {
	Debug(msg string, fields ...Field)
	Info(msg string, fields ...Field)
	Warn(msg string, fields ...Field)
	Error(msg string, fields ...Field)
	Fatal(msg string, fields ...Field)

	// With creates a child logger with the provided fields
	With(fields ...Field) Logger

	// SetLevel dynamically changes the log level
	SetLevel(level Level)

	// Sync flushes any buffered log entries
	Sync() error
}

Logger interface defines the behavior of the logging system

func NewZapLogger

func NewZapLogger(level Level, filePath string) (Logger, error)

NewZapLogger creates a new logger backed by zap opts can include file path for logging, etc.

Jump to

Keyboard shortcuts

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