logging

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package logging uses the logr.Logger interface to integrate with different logging implementation for structured logging

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithLogger

func ContextWithLogger(ctx context.Context, l Logger) context.Context

ContextWithLogger wraps the logr NewContext function

func EchoContextWithLogger

func EchoContextWithLogger(ctx echo.Context, l Logger) echo.Context

EchoContextWithLogger the logger in the given echo context

func Middleware

func Middleware(next echo.HandlerFunc, loggers ...Logger) echo.HandlerFunc

Middleware creates a production logger and sets it in the context for the incoming requests. incoming requests will have a logger that can be use in the handler.

Types

type Logger

type Logger struct {
	logr.Logger
}

func LoggerFromContext

func LoggerFromContext(ctx context.Context) Logger

LoggerFromContext wraps the LoggerFromContext or creates a Zap production logger

func LoggerFromEchoContext

func LoggerFromEchoContext(ctx echo.Context) Logger

LoggerFromEchoContext find the logger in the echo context or returns a new prom logger

func NewPromLogger

func NewPromLogger() Logger

NewPromLogger wraps the creation of a new prometheus production logger

func NewPromLoggerWithOpts

func NewPromLoggerWithOpts(lvl string) Logger

Jump to

Keyboard shortcuts

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