logger

package
v0.0.0-...-c04fabd Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TraceIdKey contextKey = "traceId"
	SpanIdKey  contextKey = "spanId"
)

Variables

This section is empty.

Functions

func GetTraceLogger

func GetTraceLogger() *zerolog.Logger

GetTraceLogger returns the trace logger

func NewLogger

func NewLogger(config Config) *zerolog.Logger

NewLogger initializes a new logger with default values if not provided

Types

type Config

type Config struct {
	LogLevel    string
	LogWriter   string
	LogFilePath string
	MaxSize     int
	MaxBackups  int
	MaxAge      int
	Compress    bool
}

type TracingHook

type TracingHook struct{}

Define TracingHook struct

func (TracingHook) Run

func (h TracingHook) Run(e *zerolog.Event, level zerolog.Level, msg string)

Run method: Executed when a log event occurs

Jump to

Keyboard shortcuts

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