zap

package module
v0.0.0-...-38e17da Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() logger.Logger

Types

type ZapLogger

type ZapLogger struct {
	*zap.Logger
}

ZapLogger is a concrete implementation of the Logger interface using zap.Logger.

func New

func New(mode string) (*ZapLogger, error)

New initializes a new zap-based Logger. It accepts the environment as a parameter to configure the logger appropriately.

func (*ZapLogger) DPanic

func (z *ZapLogger) DPanic(msg string, fields map[string]any)

func (*ZapLogger) Debug

func (z *ZapLogger) Debug(msg string, fields map[string]any)

Implementing the Logger interface methods for ZapLogger.

func (*ZapLogger) Error

func (z *ZapLogger) Error(msg string, fields map[string]any)

func (*ZapLogger) Fatal

func (z *ZapLogger) Fatal(msg string, fields map[string]any)

func (*ZapLogger) Info

func (z *ZapLogger) Info(msg string, fields map[string]any)

func (*ZapLogger) Panic

func (z *ZapLogger) Panic(msg string, fields map[string]any)

func (*ZapLogger) Sync

func (z *ZapLogger) Sync() error

func (*ZapLogger) Warn

func (z *ZapLogger) Warn(msg string, fields map[string]any)

func (*ZapLogger) WithContext

func (z *ZapLogger) WithContext(fields map[string]any) *ZapLogger

WithContext creates a new ZapLogger with contextual fields.

Jump to

Keyboard shortcuts

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