mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-01 17:18:14 +02:00
Set logger level per package instead of doing this globally
This commit is contained in:
committed by
Murat Kabilov
parent
8db44d6f18
commit
8268b07ad2
@@ -39,15 +39,16 @@ type Controller struct {
|
||||
}
|
||||
|
||||
func New(controllerConfig *Config, operatorConfig *config.Config) *Controller {
|
||||
logger := logrus.New()
|
||||
|
||||
if operatorConfig.DebugLogging {
|
||||
logrus.SetLevel(logrus.DebugLevel)
|
||||
logger.Level = logrus.DebugLevel
|
||||
}
|
||||
logger := logrus.WithField("pkg", "controller")
|
||||
logger.Debugf("Debug output enabled")
|
||||
|
||||
return &Controller{
|
||||
Config: *controllerConfig,
|
||||
opConfig: operatorConfig,
|
||||
logger: logger,
|
||||
logger: logger.WithField("pkg", "controller"),
|
||||
clusters: make(map[spec.ClusterName]*cluster.Cluster),
|
||||
stopChMap: make(map[spec.ClusterName]chan struct{}),
|
||||
podCh: make(chan spec.PodEvent),
|
||||
|
||||
Reference in New Issue
Block a user