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 ¶
- func FromRequest(r *http.Request) *loggerkit.Logger
- func GetLogger() zerolog.Logger
- func GetLoggerKit() *loggerkit.Logger
- func SanitizeEmail(email string) string
- func SanitizeHeader(header string) string
- func SanitizePhone(phone string) string
- func SanitizeString(s string) string
- func SanitizeURL(u *url.URL) string
- func SanitizeURLString(urlStr string) string
- func SetLevel(level loggerkit.Level)
- func ZerologPtr() *zerolog.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromRequest ¶ added in v0.9.0
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 ¶
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
GetLoggerKit gets the logger-kit Logger instance.
func SanitizeEmail ¶ added in v0.4.0
SanitizeEmail sanitizes email address
func SanitizeHeader ¶
SanitizeHeader sanitizes HTTP header information
func SanitizePhone ¶ added in v0.4.0
SanitizePhone sanitizes phone number
func SanitizeString ¶
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
SanitizeURL sanitizes URL by masking sensitive query parameters (phone, mail, email) Parameter names are matched case-insensitively
func SanitizeURLString ¶ added in v0.4.0
SanitizeURLString sanitizes URL string by parsing and masking sensitive query parameters
func ZerologPtr ¶ added in v0.9.0
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.