sql/gorm: Use zerolog logger

This commit is contained in:
Tom Wiesing 2022-12-02 10:25:59 +01:00
parent 6f1ba24761
commit 7006277409
No known key found for this signature in database
6 changed files with 125 additions and 8 deletions

View file

@ -1,8 +1,21 @@
package cli
import "github.com/rs/zerolog"
// Flags are global flags for the wdcli executable
type Flags struct {
ConfigPath string `short:"c" long:"config" description:"Path to distillery configuration file"`
LogLevel LogLevelString `short:"l" long:"loglevel" description:"Log level to use for logger" default:"info" choice:"trace" choice:"debug" choice:"info" choice:"warn" choice:"error" choice:"fatal" choice:"panic"`
ConfigPath string `short:"c" long:"config" description:"Path to distillery configuration file"`
InternalInDocker bool `long:"internal-in-docker" description:"Internal Flag to signal the shell that it is running inside a docker stack belonging to the distillery"`
}
type LogLevelString string
func (ls LogLevelString) Level() zerolog.Level {
level, err := zerolog.ParseLevel(string(ls))
if err != nil {
return zerolog.InfoLevel
}
return level
}