logger

package
v0.189.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close closes the logger and flushes any buffered entries

func Debug

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

Debug logs a debug message

func Error

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

Error logs an error message

func GetGlobalLogger

func GetGlobalLogger() *zap.Logger

GetGlobalLogger returns the global logger instance Useful for services that need to store a logger reference

func Info

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

Info logs an info message

func Init

func Init(cfg Config)

Init initializes the global logger (for migration period)

func NewLogger

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

NewLogger creates a new configured logger instance

func SetGlobalLogger

func SetGlobalLogger(l *zap.Logger)

SetGlobalLogger swaps the global logger (and its sugared form). It is primarily a test seam: tests build a logger over an observed core to assert what was logged. Passing nil is a no-op.

func Warn

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

Warn logs a warning message

Types

type Config

type Config struct {
	Verbose          bool
	Debug            bool
	LogDir           string
	Stdout           bool
	ArchiveEnabled   bool
	ArchiveMaxSizeMB int
	FilePrefix       string
}

Config for logger initialization

Jump to

Keyboard shortcuts

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