Skip to content

Commit

Permalink
remove leftover setMicroLogger from runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed Jul 8, 2022
1 parent 875ad91 commit 83bbaba
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions ocis/pkg/runtime/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (

"github.com/owncloud/ocis/v2/ocis-pkg/shared"

mzlog "github.com/go-micro/plugins/v4/logger/zerolog"
"github.com/mohae/deepcopy"
"github.com/olekukonko/tablewriter"

Expand Down Expand Up @@ -50,9 +49,7 @@ import (
users "github.com/owncloud/ocis/v2/services/users/pkg/command"
web "github.com/owncloud/ocis/v2/services/web/pkg/command"
webdav "github.com/owncloud/ocis/v2/services/webdav/pkg/command"
"github.com/rs/zerolog"
"github.com/thejerf/suture/v4"
"go-micro.dev/v4/logger"
)

var (
Expand Down Expand Up @@ -157,8 +154,6 @@ func Start(o ...Option) error {
halt := make(chan os.Signal, 1)
signal.Notify(halt, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT, syscall.SIGHUP)

setMicroLogger()

// tolerance controls backoff cycles from the supervisor.
tolerance := 5
totalBackoff := 0
Expand Down Expand Up @@ -301,17 +296,3 @@ func trap(s *Service, halt chan os.Signal) {
s.Log.Debug().Str("service", "runtime service").Msgf("terminating with signal: %v", s)
os.Exit(0)
}

// for logging reasons we don't want the same logging level on both oCIS and micro. As a framework builder we do not
// want to expose to the end user the internal framework logs unless explicitly specified.
func setMicroLogger() {
if os.Getenv("MICRO_LOG_LEVEL") == "" {
_ = os.Setenv("MICRO_LOG_LEVEL", "error")
}

lev, err := zerolog.ParseLevel(os.Getenv("MICRO_LOG_LEVEL"))
if err != nil {
lev = zerolog.ErrorLevel
}
logger.DefaultLogger = mzlog.NewLogger(logger.WithLevel(logger.Level(lev)))
}

0 comments on commit 83bbaba

Please sign in to comment.