logger

package
v0.0.0-...-00ede10 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*zap.Logger
}

Logger is a wrapper around zap.Logger

func New

func New(cfg *config.LoggingConfig) (*Logger, error)

New creates a new logger

func NewLogger

func NewLogger(cfg config.LoggingConfig) (*Logger, error)

NewLogger creates a new logger (alias for New)

func (*Logger) Debug

func (l *Logger) Debug(msg string, fields ...zap.Field)

Debug logs a debug message

func (*Logger) Error

func (l *Logger) Error(msg string, fields ...zap.Field)

Error logs an error message

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, err error, fields ...zap.Field)

Fatal logs a fatal message and exits

func (*Logger) Info

func (l *Logger) Info(msg string, fields ...zap.Field)

Info logs an info message

func (*Logger) Named

func (l *Logger) Named(name string) *Logger

Named returns a logger with the specified name

func (*Logger) Sync

func (l *Logger) Sync() error

Sync flushes any buffered log entries

func (*Logger) Warn

func (l *Logger) Warn(msg string, fields ...zap.Field)

Warn logs a warning message

func (*Logger) With

func (l *Logger) With(fields ...zap.Field) *Logger

With returns a logger with the specified fields

Jump to

Keyboard shortcuts

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