logger

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package logger provides logging functionality. This package now delegates to logger-kit for logging functionality, while keeping the utility functions for backward compatibility.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromRequest added in v0.9.0

func FromRequest(r *http.Request) *loggerkit.Logger

FromRequest returns the request-scoped logger from the request context, or the default logger if not set. Use this instead of zerolog/hlog in handlers and middleware.

func GetLogger

func GetLogger() zerolog.Logger

GetLogger returns zerolog.Logger for backward compatibility with code that requires zerolog (e.g. middleware-kit Config). Prefer GetLoggerKit or ZerologPtr for new code.

func GetLoggerKit added in v0.8.0

func GetLoggerKit() *loggerkit.Logger

GetLoggerKit gets the logger-kit Logger instance.

func SanitizeEmail added in v0.4.0

func SanitizeEmail(email string) string

SanitizeEmail sanitizes email address

func SanitizeHeader

func SanitizeHeader(header string) string

SanitizeHeader sanitizes HTTP header information

func SanitizePhone added in v0.4.0

func SanitizePhone(phone string) string

SanitizePhone sanitizes phone number

func SanitizeString

func SanitizeString(s string) string

SanitizeString sanitizes sensitive information Performs partial sanitization on strings that may contain sensitive information Uses secure-kit's MaskString for consistent masking behavior

func SanitizeURL added in v0.4.0

func SanitizeURL(u *url.URL) string

SanitizeURL sanitizes URL by masking sensitive query parameters (phone, mail, email) Parameter names are matched case-insensitively

func SanitizeURLString added in v0.4.0

func SanitizeURLString(urlStr string) string

SanitizeURLString sanitizes URL string by parsing and masking sensitive query parameters

func SetLevel

func SetLevel(level loggerkit.Level)

SetLevel sets log level at runtime (logger-kit only).

func ZerologPtr added in v0.9.0

func ZerologPtr() *zerolog.Logger

ZerologPtr returns a pointer to the underlying zerolog.Logger for use when filling middleware-kit Config.Logger (e.g. RateLimit, APIKey, BodyLimit). Implemented via log.Zerolog() so warden works with published logger-kit that may not expose ZerologPtr().

Types

This section is empty.

Jump to

Keyboard shortcuts

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