logging

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRequestID

func GenerateRequestID() string

GenerateRequestID creates a new 8-character hex request ID.

func GetRequestID

func GetRequestID(ctx context.Context) string

GetRequestID retrieves the request ID from the context. Returns empty string if not found.

func SetupBaseLogger

func SetupBaseLogger()

SetupBaseLogger configures the shared logrus instance. It is safe to call multiple times; initialization happens only once.

func WithRequestID

func WithRequestID(ctx context.Context, requestID string) context.Context

WithRequestID returns a new context with the request ID attached.

Types

type LogFormatter

type LogFormatter struct{}

LogFormatter defines a custom log format for logrus. This formatter adds timestamp, level, request ID, and source location to each log entry. Format: [2025-12-23 20:14:04] [debug] [manager.go:524] | a1b2c3d4 | Use API key sk-9...0RHO for model gpt-5.2

func (*LogFormatter) Format

func (m *LogFormatter) Format(entry *log.Entry) ([]byte, error)

Format renders a single log entry with custom formatting.

Jump to

Keyboard shortcuts

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