Skip to content

Commit

Permalink
fix: dont print to stdout using color/non json formatted output when …
Browse files Browse the repository at this point in the history
…running with JSON output logger (#1188)
  • Loading branch information
markphelps authored Dec 1, 2022
1 parent 6aaace6 commit 79f86b2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cmd/flipt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,18 @@ func run(ctx context.Context, logger *zap.Logger) error {

switch cv.Compare(lv) {
case 0:
color.Green("You are currently running the latest version of Flipt [%s]!", cv)
if isConsole {
color.Green("You are currently running the latest version of Flipt [%s]!", cv)
} else {
logger.Info("running latest version", zap.Stringer("version", cv))
}
case -1:
updateAvailable = true
color.Yellow("A newer version of Flipt exists at %s, \nplease consider updating to the latest version.", release.GetHTMLURL())
if isConsole {
color.Yellow("A newer version of Flipt exists at %s, \nplease consider updating to the latest version.", release.GetHTMLURL())
} else {
logger.Info("newer version available", zap.Stringer("version", lv), zap.String("url", release.GetHTMLURL()))
}
}
}
}
Expand Down

0 comments on commit 79f86b2

Please sign in to comment.