logger

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

Debug logs a debug message

func Error

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

Error logs an error message

func Fatal

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

Fatal logs a fatal message and exits

func Info

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

Info logs an info message

func Init

func Init(level LogLevel)

Init initializes the global logger with the specified log level

func Logger

func Logger() *zap.Logger

Logger returns the global logger instance

func Sugar

func Sugar() *zap.SugaredLogger

Sugar returns the global sugar logger instance

func Sync

func Sync() error

Sync flushes any buffered log entries

func Warn

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

Warn logs a warning message

func WithFields

func WithFields(fields ...zap.Field) *zap.Logger

WithFields creates a new logger with the given fields

Types

type LogLevel

type LogLevel string

LogLevel represents log levels

const (
	DebugLevel LogLevel = "debug"
	InfoLevel  LogLevel = "info"
	WarnLevel  LogLevel = "warn"
	ErrorLevel LogLevel = "error"
	FatalLevel LogLevel = "fatal"
)

Jump to

Keyboard shortcuts

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