Documentation ¶
Index ¶
- Constants
- func NewConfigFromConfigMap(configMap *corev1.ConfigMap) (*logging.Config, error)
- func NewConfigFromMap(data map[string]string) (*logging.Config, error)
- func NewLogger(configJSON string, levelOverride string) (*zap.SugaredLogger, zap.AtomicLevel)
- func NewLoggerFromConfig(config *logging.Config, name string) (*zap.SugaredLogger, zap.AtomicLevel)
- func UpdateLevelFromConfigMap(logger *zap.SugaredLogger, atomicLevel zap.AtomicLevel, levelKey string) func(configMap *corev1.ConfigMap)
Constants ¶
View Source
const ( // ConfigName is the name of the ConfigMap that the logging config will be stored in ConfigName = "config-logging" // ControllerLogKey is the name of the logger for the controller cmd ControllerLogKey = "controller" // WebhookLogKey is the name of the logger for the webhook cmd WebhookLogKey = "webhook" )
Variables ¶
This section is empty.
Functions ¶
func NewConfigFromConfigMap ¶
NewConfigFromConfigMap creates a LoggingConfig from the supplied ConfigMap
func NewConfigFromMap ¶
NewConfigFromMap creates a LoggingConfig from the supplied map
func NewLogger ¶
func NewLogger(configJSON string, levelOverride string) (*zap.SugaredLogger, zap.AtomicLevel)
NewLogger creates a logger with the supplied configuration. In addition to the logger, it returns AtomicLevel that can be used to change the logging level at runtime. If configuration is empty, a fallback configuration is used. If configuration cannot be used to instantiate a logger, the same fallback configuration is used.
func NewLoggerFromConfig ¶
func NewLoggerFromConfig(config *logging.Config, name string) (*zap.SugaredLogger, zap.AtomicLevel)
NewLoggerFromConfig creates a logger using the provided Config
func UpdateLevelFromConfigMap ¶
func UpdateLevelFromConfigMap(logger *zap.SugaredLogger, atomicLevel zap.AtomicLevel, levelKey string) func(configMap *corev1.ConfigMap)
UpdateLevelFromConfigMap returns a helper func that can be used to update the logging level when a config map is updated
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.