logging

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENV_NAME = "APP_ENV"
	ENV_DEV  = "dev"
)
View Source
const (
	// #nosec G101 -- Not a secret
	TraceToken = "X-Trace-Token"
)

Variables

This section is empty.

Functions

func LogDebug

func LogDebug(token, msg string)

func LogError

func LogError(token, msg string)

func LogInfo

func LogInfo(token, msg string)

func LogResponse

func LogResponse(token string, req *http.Request, lw *LoggingResponseMetadata, duration time.Duration)

func LogWarn

func LogWarn(token, msg string)

func NewLoggerBuilder added in v1.1.0

func NewLoggerBuilder() *loggerBuilder

Types

type LoggingResponseMetadata

type LoggingResponseMetadata struct {
	Status int
	Size   int
}

LoggingResponseMetadata wrapper for holding response metadata

type LoggingResponseWriter

type LoggingResponseWriter struct {
	http.ResponseWriter
	ResponseMetadata *LoggingResponseMetadata
}

LoggingResponseWriter wrapper around the default response writer to enable the logging of the response metadata

func (*LoggingResponseWriter) Write

func (w *LoggingResponseWriter) Write(b []byte) (int, error)

func (*LoggingResponseWriter) WriteHeader

func (w *LoggingResponseWriter) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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