Skip to content

Commit

Permalink
Register Kubernetes log package early
Browse files Browse the repository at this point in the history
  • Loading branch information
smarterclayton committed Sep 16, 2016
1 parent 3de3eec commit ac04088
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cmd/dockerregistry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"runtime"

log "github.com/Sirupsen/logrus"
"k8s.io/kubernetes/pkg/util/logs"

"github.com/openshift/origin/pkg/cmd/dockerregistry"
cmdutil "github.com/openshift/origin/pkg/cmd/util"
"github.com/openshift/origin/pkg/cmd/util/serviceability"
Expand All @@ -20,6 +22,8 @@ import (
)

func main() {
logs.InitLogs()
defer logs.FlushLogs()
defer serviceability.BehaviorOnPanic(os.Getenv("OPENSHIFT_ON_PANIC"))()
defer serviceability.Profile(os.Getenv("OPENSHIFT_PROFILE")).Stop()
startProfiler()
Expand Down
4 changes: 4 additions & 0 deletions cmd/gitserver/gitserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"path/filepath"
"runtime"

"k8s.io/kubernetes/pkg/util/logs"

"github.com/openshift/origin/pkg/cmd/infra/gitserver"
"github.com/openshift/origin/pkg/cmd/util/serviceability"

Expand All @@ -15,6 +17,8 @@ import (
)

func main() {
logs.InitLogs()
defer logs.FlushLogs()
defer serviceability.BehaviorOnPanic(os.Getenv("OPENSHIFT_ON_PANIC"))()
defer serviceability.Profile(os.Getenv("OPENSHIFT_PROFILE")).Stop()

Expand Down
4 changes: 4 additions & 0 deletions cmd/oc/oc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"path/filepath"
"runtime"

"k8s.io/kubernetes/pkg/util/logs"

"github.com/openshift/origin/pkg/cmd/cli"
"github.com/openshift/origin/pkg/cmd/util/serviceability"

Expand All @@ -17,6 +19,8 @@ import (
)

func main() {
logs.InitLogs()
defer logs.FlushLogs()
defer serviceability.BehaviorOnPanic(os.Getenv("OPENSHIFT_ON_PANIC"))()
defer serviceability.Profile(os.Getenv("OPENSHIFT_PROFILE")).Stop()

Expand Down
6 changes: 3 additions & 3 deletions cmd/openshift/openshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"path/filepath"
"runtime"

"github.com/golang/glog"
"k8s.io/kubernetes/pkg/util/logs"

"github.com/openshift/origin/pkg/cmd/openshift"
"github.com/openshift/origin/pkg/cmd/util/serviceability"
Expand All @@ -19,11 +19,11 @@ import (
)

func main() {
logs.InitLogs()
defer logs.FlushLogs()
defer serviceability.BehaviorOnPanic(os.Getenv("OPENSHIFT_ON_PANIC"))()
defer serviceability.Profile(os.Getenv("OPENSHIFT_PROFILE")).Stop()

glog.CopyStandardLogTo("INFO")

if len(os.Getenv("GOMAXPROCS")) == 0 {
runtime.GOMAXPROCS(runtime.NumCPU())
}
Expand Down

0 comments on commit ac04088

Please sign in to comment.