logger

package
v0.0.0-...-14802c6 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get() *zap.Logger

Get returns the global logger.

func GlobalLogger

func GlobalLogger() interfaces.Logger

GlobalLogger returns an interfaces.Logger backed by the global zap logger.

func Init

func Init(level, format string) error

Init initializes the global logger.

func NamedLogger

func NamedLogger(name string) interfaces.Logger

NamedLogger creates a named interfaces.Logger from the global logger.

func SetOutput

func SetOutput(w io.Writer) error

SetOutput sets the output writer for the global logger.

func StdLogWriter

func StdLogWriter() io.Writer

StdLogWriter returns an io.Writer that logs to the global logger.

func Sync

func Sync() error

Sync flushes the global logger.

Types

type ZapLogger

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

ZapLogger adapts *zap.Logger to interfaces.Logger.

func (*ZapLogger) Debug

func (z *ZapLogger) Debug(msg string, keysAndValues ...any)

func (*ZapLogger) Error

func (z *ZapLogger) Error(msg string, keysAndValues ...any)

func (*ZapLogger) Info

func (z *ZapLogger) Info(msg string, keysAndValues ...any)

func (*ZapLogger) Named

func (z *ZapLogger) Named(name string) interfaces.Logger

func (*ZapLogger) Warn

func (z *ZapLogger) Warn(msg string, keysAndValues ...any)

func (*ZapLogger) With

func (z *ZapLogger) With(keysAndValues ...any) interfaces.Logger

Jump to

Keyboard shortcuts

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