mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-17 17:17:53 +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
@@ -61,8 +61,8 @@ type Cluster struct {
|
||||
mu sync.Mutex
|
||||
}
|
||||
|
||||
func New(cfg Config, pgSpec spec.Postgresql) *Cluster {
|
||||
lg := logrus.WithField("pkg", "cluster").WithField("cluster-name", pgSpec.Metadata.Name)
|
||||
func New(cfg Config, pgSpec spec.Postgresql, logger *logrus.Logger) *Cluster {
|
||||
lg := logger.WithField("pkg", "cluster").WithField("cluster-name", pgSpec.Metadata.Name)
|
||||
kubeResources := KubeResources{Secrets: make(map[types.UID]*v1.Secret)}
|
||||
|
||||
cluster := &Cluster{
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ func (c *Cluster) logPodChanges(pod *v1.Pod, statefulset *v1beta1.StatefulSet, r
|
||||
if len(pod.Spec.Containers) == 1 {
|
||||
podContainer := pod.Spec.Containers[0]
|
||||
templateContainer := statefulset.Spec.Template.Spec.Containers[0]
|
||||
c.logger.Debugf("diff\n%s", util.PrettyDiff(podContainer, templateContainer))
|
||||
c.logger.Debugf("diff pod <-> statefulset\n%s", util.PrettyDiff(podContainer, templateContainer))
|
||||
}
|
||||
if reason != "" {
|
||||
c.logger.Infof("Reason: %s", reason)
|
||||
|
||||
Reference in New Issue
Block a user