logger

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2025 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...any)

func Debugf

func Debugf(fmt string, args ...any)

func Error

func Error(args ...any)

func Errorf

func Errorf(fmt string, args ...any)

func HotReload added in v1.1.0

func HotReload(conf *zap.Config) error

HotReload rebuilds from a new zap.Config (e.g., re-read YAML).

func Info

func Info(args ...any)

func Infof

func Infof(fmt string, args ...any)

func InitLog

func InitLog(logConfFile string) error

InitLog loads from YAML file; falls back to development defaults when file is absent/invalid.

func InitLogger

func InitLogger(conf *zap.Config)

InitLogger initializes logger. Default is development-style (console, debug), but we force stacktrace to Error+ only, and enable caller with our custom encoder. If a config is supplied, we respect it and only normalize caller encoder and stacktrace threshold.

func PaddedCallerEncoder added in v1.1.0

func PaddedCallerEncoder(caller zapcore.EntryCaller, enc zapcore.PrimitiveArrayEncoder)

PaddedCallerEncoder aligns caller path to a fixed width for prettier console output.

func ParseLogLevel added in v1.1.0

func ParseLogLevel(level string) zapcore.Level

ParseLogLevel parses textual level to zapcore.Level.

func SetLoggerLevel

func SetLoggerLevel(level zapcore.Level) bool

SetLoggerLevel changes the level at runtime without rebuilding logger.

func Warn

func Warn(args ...any)

func Warnf

func Warnf(fmt string, args ...any)

Types

type PixiuLogger added in v1.1.0

type PixiuLogger struct {
	*zap.SugaredLogger
	// contains filtered or unexported fields
}

func GetLogger

func GetLogger() *PixiuLogger

GetLogger exposes the current sugared logger.

type TripleLogger added in v1.1.0

type TripleLogger struct {
}

TripleLogger does not add user-defined log fields, so there will be no pointer reference issues after updates, ensuring that all references are under control.

func GetTripleLogger added in v1.1.0

func GetTripleLogger() *TripleLogger

func (*TripleLogger) Debug added in v1.1.0

func (l *TripleLogger) Debug(args ...any)

func (*TripleLogger) Debugf added in v1.1.0

func (l *TripleLogger) Debugf(fmt string, args ...any)

func (*TripleLogger) Error added in v1.1.0

func (l *TripleLogger) Error(args ...any)

func (*TripleLogger) Errorf added in v1.1.0

func (l *TripleLogger) Errorf(fmt string, args ...any)

func (*TripleLogger) Info added in v1.1.0

func (l *TripleLogger) Info(args ...any)

func (*TripleLogger) Infof added in v1.1.0

func (l *TripleLogger) Infof(fmt string, args ...any)

func (*TripleLogger) Warn added in v1.1.0

func (l *TripleLogger) Warn(args ...any)

func (*TripleLogger) Warnf added in v1.1.0

func (l *TripleLogger) Warnf(fmt string, args ...any)

Jump to

Keyboard shortcuts

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