3
0

Refactor log init, add new env options, filter

This commit is contained in:
Denis Arh
2021-08-26 17:24:19 +02:00
parent e48ffb2e08
commit 77b593a192
28 changed files with 1731 additions and 135 deletions
-9
View File
@@ -1,11 +1,8 @@
package cli
import (
"github.com/cortezaproject/corteza-server/pkg/logger"
"github.com/cortezaproject/corteza-server/pkg/version"
"github.com/spf13/cobra"
"go.uber.org/zap"
"os"
)
var (
@@ -67,12 +64,6 @@ func RootCommand(ppRunEfn func() error) *cobra.Command {
func ServeCommand(runEfn func() error) *cobra.Command {
serveApiCommand.RunE = func(cmd *cobra.Command, args []string) (err error) {
if _, set := os.LookupEnv("LOG_LEVEL"); !set {
// If LOG_LEVEL is not explicitly set, let's
// set it to INFO so that it
logger.DefaultLevel.SetLevel(zap.InfoLevel)
}
return runEfn()
}