log

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Logger is the global logger instance
	Logger zerolog.Logger
)

Functions

func Debug

func Debug(msg string)

func Error

func Error(msg string)

func Errorf

func Errorf(format string, err error)

func Fatal

func Fatal(msg string)

func Info

func Info(msg string)

Helper functions for common logging patterns

func Init

func Init(cfg Config)

Init initializes the global logger

func Warn

func Warn(msg string)

func WithComponent

func WithComponent(component string) zerolog.Logger

WithComponent creates a child logger with component field

func WithNodeID

func WithNodeID(nodeID string) zerolog.Logger

WithNodeID creates a child logger with node_id field

func WithServiceID

func WithServiceID(serviceID string) zerolog.Logger

WithServiceID creates a child logger with service_id field

func WithTaskID

func WithTaskID(taskID string) zerolog.Logger

WithTaskID creates a child logger with task_id field

Types

type Config

type Config struct {
	Level      Level
	JSONOutput bool
	Output     io.Writer
}

Config holds logging configuration

type Level

type Level string

Level represents log level

const (
	DebugLevel Level = "debug"
	InfoLevel  Level = "info"
	WarnLevel  Level = "warn"
	ErrorLevel Level = "error"
)

Jump to

Keyboard shortcuts

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