0
0
mirror of https://github.com/thegeeklab/git-sv.git synced 2024-06-02 17:39:39 +02:00

fix: ensure logger is configured before first usage (#12)

This commit is contained in:
Robert Kaussow 2023-10-17 15:23:29 +02:00 committed by GitHub
parent 66b6f803b8
commit 53af856cc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,7 @@ var (
func main() {
gsv := app.New()
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
cli.VersionPrinter = func(c *cli.Context) {
fmt.Printf("%s version=%s date=%s\n", c.App.Name, c.App.Version, BuildDate)
}
@ -38,8 +39,6 @@ func main() {
},
},
Before: func(ctx *cli.Context) error {
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
lvl, err := zerolog.ParseLevel(gsv.Settings.LogLevel)
if err != nil {
return err