log

package
v0.0.0-...-aad8beb Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKeyValueEncoder

func NewKeyValueEncoder(cfg zapcore.EncoderConfig) zapcore.Encoder

NewKeyValueEncoder creates a key=value encoder

Types

type Logger

type Logger interface {
	// Debug write a debug log level
	Debug(context context.Context, action string, message string, extraFields map[string]string)

	// Info write a info log level
	Info(context context.Context, action string, message string, extraFields map[string]string)

	// Warn write a warning log level
	Warn(context context.Context, action string, message string, extraFields map[string]string)

	// Error write a error log level
	Error(context context.Context, action string, message string, extraFields map[string]string)

	// Fatal write a fatal log level. The logger then calls os.Exit(1), even if logging at Fatal level is disabled.
	Fatal(context context.Context, action string, message string, extraFields map[string]string)

	// Panic write a Panic log level. Then panics then panic, even if logging at Panic level is disabled.
	Panic(context context.Context, action string, message string, extraFields map[string]string)
}

Logger is a interface to log object

func GetLogger

func GetLogger() Logger

GetLogger return a new instance of the log for the application

Jump to

Keyboard shortcuts

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