Skip to content

Commit

Permalink
fix: ensure logger is configured before first usage (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoxys authored Oct 17, 2023
1 parent 66b6f80 commit 53af856
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/git-sv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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
Expand Down

0 comments on commit 53af856

Please sign in to comment.