Documentation
¶
Overview ¶
Package logger provides a slog.Logger that can be configured via environment variables. CONTRAST_LOG_LEVEL can be used to set the log level. CONTRAST_LOG_FORMAT can be used to set the log format. It also offer a slog.Handler that can be used to enable logging on a per-subsystem basis. CONTRAST_LOG_SUBSYSTEMS can be used to enable logging for specific subsystems. If CONTRAST_LOG_SUBSYSTEMS has the special value "*", all subsystems are enabled. Otherwise, a comma-separated list of subsystem names can be specified.
Index ¶
Constants ¶
View Source
const ( // LogLevel is the environment variable used to set the log level. LogLevel = "CONTRAST_LOG_LEVEL" // LogFormat is the environment variable used to set the log format. LogFormat = "CONTRAST_LOG_FORMAT" // LogSubsystems is the environment variable used to enable logging for specific subsystems. LogSubsystems = "CONTRAST_LOG_SUBSYSTEMS" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a slog.Handler that can be used to enable logging on a per-subsystem basis.
func NewHandler ¶
NewHandler returns a new Handler.
Click to show internal directories.
Click to hide internal directories.