log

package
v2.0.26 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

config.go

log.go

Index

Constants

This section is empty.

Variables

View Source
var (
	E2eConnMutex sync.RWMutex
	E2EConnCfg   *e2eConnConfig
)
View Source
var (
	// ErrLoggerAlreadyInitialized is the error returned when the logger is already initialized
	ErrLoggerAlreadyInitialized = errors.New("logger already initialized")
)

Global variables

Functions

func Debug

func Debug(msg string, args ...any)

Debug logs a message at the debug level

func Error

func Error(msg string, args ...any)

Error logs a message at the error level

func Info

func Info(msg string, args ...any)

Info logs a message at the info level

func Start

func Start() error

Start initializes the logging package with the given configuration. If no configuration is provided, it uses the default configuration.

func Stop

func Stop()

Stop gracefully shuts down the logging system

func Warn

func Warn(msg string, args ...any)

Warn logs a message at the warn level

Types

type FieldedLogger

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

FieldedLogger allows adding predefined fields to log entries

func NewFieldedLogger

func NewFieldedLogger(args *Fields) *FieldedLogger

NewFieldedLogger creates a new FieldedLogger with the given fields

func (*FieldedLogger) Debug

func (fl *FieldedLogger) Debug(msg string, args ...any)

Debug logs a message at the debug level with the predefined fields

func (*FieldedLogger) Error

func (fl *FieldedLogger) Error(msg string, args ...any)

Error logs a message at the error level with the predefined fields

func (*FieldedLogger) Info

func (fl *FieldedLogger) Info(msg string, args ...any)

Info logs a message at the info level with the predefined fields

func (*FieldedLogger) Warn

func (fl *FieldedLogger) Warn(msg string, args ...any)

Warn logs a message at the warn level with the predefined fields

type Fields

type Fields map[string]any

Field defines an interface for fields

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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