logger

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubscriptionID  string = "subscription_id"
	RequestID       string = "request_id"
	CallerID        string = "caller_id"
	Version         string = "version"
	Global          string = "global"
	Expiry          string = "expiry"
	IncludeChildren string = "include_children"
	Path            string = "path"
	Role            string = "role"
	PathURL         string = "path_url"
	PathWildCardURL string = "path_wild_card_url"
)

Variables

View Source
var DebugContextKeys = []string{SubscriptionID, RequestID}

DebugContextKeys defines variables from the context to be included in each log line

Functions

func GetLogger

func GetLogger() *zerolog.Logger

func InitLogger

func InitLogger(level, service string, logOutput io.Writer)

Types

type ContextHook

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

func (ContextHook) Run

func (h ContextHook) Run(e *zerolog.Event, _ zerolog.Level, _ string)

type FunctionNameHook

type FunctionNameHook struct{}

FunctionNameHook is a zerolog.Hook that adds the function name to the logger's context.

func (FunctionNameHook) Levels

func (h FunctionNameHook) Levels() []zerolog.Level

Levels returns the log levels that this hook should be enabled for.

func (FunctionNameHook) Run

Run is called for every log entry.

type LoggingService

type LoggingService interface {
	Err(msg string, metadata map[string]any, err error)
	ErrCtx(ctx context.Context, msg string, metadata map[string]any, err error)
	Info(msg string, metadata map[string]any)
	InfoCtx(ctx context.Context, msg string, metadata map[string]any)
	Panic(msg string, metadata map[string]any)
	PanicCtx(ctx context.Context, msg string, metadata map[string]any)
	Debug(msg string, ctx map[string]any)
	DebugCtx(ctx context.Context, msg string, metadata map[string]any)
}

Jump to

Keyboard shortcuts

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