logging

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Unlicense Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LogEntriesTotal counts log entries by level
	LogEntriesTotal = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "longbow_log_entries_total",
			Help: "Total number of log entries by level",
		},
		[]string{"level"},
	)

	// LogErrorsTotal counts error-level log entries specifically
	LogErrorsTotal = promauto.NewCounter(
		prometheus.CounterOpts{
			Name: "longbow_log_errors_total",
			Help: "Total number of error log entries",
		},
	)
)

Prometheus metrics for logging operations

Functions

func DiscardLogger

func DiscardLogger() *zap.Logger

DiscardLogger returns a logger that discards all output (useful for tests)

func NewLogger

func NewLogger(cfg Config) (*zap.Logger, error)

NewLogger creates a new zap logger based on the provided configuration

Types

type Config

type Config struct {
	// Format specifies the log output format: "json" or "text"
	Format string
	// Level specifies the minimum log level: "debug", "info", "warn", "error"
	Level string
	// Output specifies where logs are written (defaults to os.Stdout)
	Output zapcore.WriteSyncer
}

Config holds logger configuration options

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default logger configuration

Jump to

Keyboard shortcuts

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