Documentation ¶
Index ¶
- func GetLogLevel() (operatorv1.LogLevel, bool)
- func LogLevelToVerbosity(logLevel operatorv1.LogLevel) int
- func NewClusterOperatorLoggingController(operatorClient operatorv1helpers.OperatorClient, recorder events.Recorder) factory.Controller
- func NewClusterOperatorLoggingControllerWithLogLevel(operatorClient operatorv1helpers.OperatorClient, ...) factory.Controller
- func SetLogLevel(targetLevel operatorv1.LogLevel) error
- func ValidLogLevel(logLevel operatorv1.LogLevel) bool
- type LogLevelController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLogLevel ¶
func GetLogLevel() (operatorv1.LogLevel, bool)
GetLogLevel attempts to guess the current log level that is used by klog. The bool value returned determine whether we were able to determine the current log level or not. We can use flags here as well, but this is less ugly ano more programmatically correct than flags.
func LogLevelToVerbosity ¶
func LogLevelToVerbosity(logLevel operatorv1.LogLevel) int
LogLevelToVerbosity transforms operator log level to a klog numeric verbosity level.
func NewClusterOperatorLoggingController ¶
func NewClusterOperatorLoggingController(operatorClient operatorv1helpers.OperatorClient, recorder events.Recorder) factory.Controller
NewClusterOperatorLoggingController sets a klog level for the operator based on the operator config. If the loglevel is not set the default "Normal" level will be used. This controller supports removable operands, as configured in pkg/operator/management and uses level "Normal" if the operator CR is missing.
func NewClusterOperatorLoggingControllerWithLogLevel ¶
func NewClusterOperatorLoggingControllerWithLogLevel(operatorClient operatorv1helpers.OperatorClient, defaultLogLevel operatorv1.LogLevel, recorder events.Recorder) factory.Controller
NewClusterOperatorLoggingControllerWithLogLevel sets a klog level for the operator based on the operator config, using the given default log level if the operator config does not specify anything
func SetLogLevel ¶
func SetLogLevel(targetLevel operatorv1.LogLevel) error
SetLogLevel is a nasty hack and attempt to manipulate the global flags as klog does not expose a way to dynamically change the loglevel in runtime.
func ValidLogLevel ¶
func ValidLogLevel(logLevel operatorv1.LogLevel) bool
Types ¶
type LogLevelController ¶
type LogLevelController struct {
// contains filtered or unexported fields
}