Set logger level per package instead of doing this globally

This commit is contained in:
Oleksii Kliukin
2017-05-12 11:41:30 +02:00
committed by Murat Kabilov
parent 8db44d6f18
commit 8268b07ad2
4 changed files with 10 additions and 9 deletions
+2 -2
View File
@@ -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{