Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #100 from ibuildthecloud/main
Browse files Browse the repository at this point in the history
Set klog to logrus also
  • Loading branch information
ibuildthecloud committed Aug 18, 2023
2 parents 5b03d4c + 0962719 commit 36c10b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require (
k8s.io/api v0.27.2
k8s.io/apimachinery v0.27.2
k8s.io/client-go v0.27.2
k8s.io/klog/v2 v2.90.1
k8s.io/utils v0.0.0-20230209194617-a36077c30491
sigs.k8s.io/controller-runtime v0.15.0-beta.0
sigs.k8s.io/controller-tools v0.12.0
Expand Down Expand Up @@ -65,7 +66,6 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
mvdan.cc/gofumpt v0.4.0 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
Expand Down
5 changes: 4 additions & 1 deletion pkg/logrus/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import (
"github.com/acorn-io/baaah/pkg/log"
"github.com/bombsimon/logrusr/v4"
"github.com/sirupsen/logrus"
klogv2 "k8s.io/klog/v2"
crlog "sigs.k8s.io/controller-runtime/pkg/log"
)

func init() {
crlog.SetLogger(logrusr.New(logrus.StandardLogger()))
l := logrusr.New(logrus.StandardLogger())
klogv2.SetLogger(l)
crlog.SetLogger(l)
log.SetLogger(logrus.StandardLogger())
}

0 comments on commit 36c10b8

Please sign in to comment.