logging

package
v0.0.0-...-64bc6a5 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: Apache-2.0 Imports: 4 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, fields ...zap.Field)

Convenience functions for common log levels

func Error

func Error(msg string, fields ...zap.Field)

func Fatal

func Fatal(msg string, fields ...zap.Field)

func GetLogger

func GetLogger() *zap.Logger

GetLogger returns the global logger instance

func Info

func Info(msg string, fields ...zap.Field)

func Init

func Init(config *Config) error

Init initializes the global logger with the given configuration

func SetLevel

func SetLevel(level string) error

SetLevel dynamically changes the log level

func Sync

func Sync() error

Sync flushes any buffered log entries

func Warn

func Warn(msg string, fields ...zap.Field)

Types

type Config

type Config struct {
	Level  string `json:"level" yaml:"level"`   // debug, info, warn, error
	Format string `json:"format" yaml:"format"` // json, console
}

Config holds the logging configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default logging configuration

Jump to

Keyboard shortcuts

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