logging

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustInitialize

func MustInitialize(ctx context.Context, component string) (*logrus.Entry, func())

MustInitialize configures labkit's shared logger to emit structured JSON logs and returns a component-scoped logger plus a close function to defer in main(). Call this once, at the start of main(), before creating any other loggers. Exits the process if logger initialization fails.

func NewGrpcLogger

func NewGrpcLogger(component string) (*logrus.Entry, grpc.UnaryServerInterceptor)

NewGrpcLogger returns a component-scoped logger and a gRPC interceptor that emits access logs. MustInitialize must be called first (typically in main()), or the returned logger and access logs fall back to labkit's default text format.

func NewHttpLogger

func NewHttpLogger(component string, upstream http.Handler) (*logrus.Entry, http.Handler)

NewHttpLogger returns a component-scoped logger and an HTTP handler that emits access logs. MustInitialize must be called first (typically in main()), or the returned logger and access logs fall back to labkit's default text format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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