remove leftover setMicroLogger from runtime

This commit is contained in:
Willy Kloucek
2022-07-08 07:55:11 +02:00
parent 875ad911db
commit 83bbabac3c

View File

@@ -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"
@@ -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 (
@@ -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
@@ -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)))
}