log

package
v0.0.0-...-400441b Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 3 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 {
	// Debug logs a debug message.
	Debug(format string, args ...any)
	// Info logs an info message.
	Info(format string, args ...any)
	// Warn logs a warning message.
	Warn(format string, args ...any)
	// Error logs an error message.
	Error(format string, args ...any)
	// Fatal logs a fatal message.
	Fatal(format string, args ...any)
	// Panic logs a panic message.
	Panic(format string, args ...any)
	// Close flushes any buffered log entries.
	Close() error
}

Logger is an interface that defines the methods for the logger.

func New

func New() (Logger, error)

New initializes the logger.

type Zap

type Zap struct {
	*zap.SugaredLogger
}

Zap is a wrapper for the log interface using zap library.

func (*Zap) Close

func (z *Zap) Close() error

Close flushes any buffered log entries.

func (*Zap) Debug

func (z *Zap) Debug(format string, args ...any)

Debug logs a debug message.

func (*Zap) Error

func (z *Zap) Error(format string, args ...any)

Error logs an error message.

func (*Zap) Fatal

func (z *Zap) Fatal(format string, args ...any)

Fatal logs a fatal message.

func (*Zap) Info

func (z *Zap) Info(format string, args ...any)

Info logs an info message.

func (*Zap) Panic

func (z *Zap) Panic(format string, args ...any)

Panic logs a panic message.

func (*Zap) Warn

func (z *Zap) Warn(format string, args ...any)

Warn logs a warning message.

Jump to

Keyboard shortcuts

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