zlogger

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextKeyRequestID  contextKey = "reqId"
	ContextKeyDocumentId contextKey = "documentId"
)

Variables

View Source
var GLogger *logger = &logger{}

Functions

This section is empty.

Types

type Field

type Field = zap.Field

func GetFieldsFunctions

func GetFieldsFunctions(funcName string) Field

func GetFieldsKafkaMessageType

func GetFieldsKafkaMessageType(messageType string) Field

func GetFieldsReqId

func GetFieldsReqId(requestId string) Field

func GetFieldsTrace

func GetFieldsTrace(traceId string) Field

func GetFieldsWorkerID

func GetFieldsWorkerID(workerID string) Field

type Logger

type Logger interface {
	Debug(args ...interface{})
	Debugf(template string, args ...interface{})
	Info(args ...interface{})
	Infof(template string, args ...interface{})
	Warn(args ...interface{})
	Warnf(template string, args ...interface{})
	Error(args ...interface{})
	Errorf(template string, args ...interface{})
	DPanic(args ...interface{})
	DPanicf(template string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(template string, args ...interface{})
	// log with field
	InfoWithField(msg string, f ...Field)
}

Logger methods interface

func NewLogger

func NewLogger(mode, level, format, service string) Logger

App Logger constructor

Jump to

Keyboard shortcuts

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