logger

package
v0.0.0-...-9fae85f Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 5 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 interface {
	Info(msg string)
	Error(msg string)
	Fatal(msg string)
	Debug(msg string)
	Warn(msg string)
	Init() error
	Event(e *debug.Event)
}

Logger defines the interface for logging functions.

type ZapLogger

type ZapLogger struct {
	// contains filtered or unexported fields
}

ZapLogger is a concrete implementation of Logger using Zap.

func New

func New(level zapcore.Level) (
	*ZapLogger,
	error,
)

New creates a new Logger instance with the given log level.

func (*ZapLogger) Debug

func (l *ZapLogger) Debug(msg string)

Debug logs a message at the Debug level.

func (*ZapLogger) Error

func (l *ZapLogger) Error(msg string)

Error logs a message at the Error level.

func (*ZapLogger) Event

func (l *ZapLogger) Event(e *debug.Event)

Event logs a debug event.

func (*ZapLogger) Fatal

func (l *ZapLogger) Fatal(msg string)

Fatal logs a message at the Fatal level, then exits the process.

func (*ZapLogger) Info

func (l *ZapLogger) Info(msg string)

Info logs a message at the Info level.

func (*ZapLogger) Init

func (l *ZapLogger) Init() error

Init initializes the logger.

func (*ZapLogger) Warn

func (l *ZapLogger) Warn(msg string)

Warn logs a message at the Warn level.

Jump to

Keyboard shortcuts

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