Skip to content

Commit

Permalink
fix(governctl): Bump kraftkit code
Browse files Browse the repository at this point in the history
Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
  • Loading branch information
craciunoiuc committed Apr 29, 2024
1 parent 2783266 commit bf978f5
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions cmd/governctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@ func main() {
if err != nil {
panic(err)
}

cmd := New()

// Set up the global context
ctx := signals.SetupSignalContext()
ctx = kitcfg.WithConfigManager(ctx, cfgm)

// Attribute all configuration flags and command-line argument values
cmd, args, err := cmd.Find(os.Args[1:])
if err != nil {
Expand All @@ -82,13 +85,19 @@ func main() {
fmt.Println(err)
os.Exit(1)
}

// Set up the global context
ctx := signals.SetupSignalContext()
ctx = kitcfg.WithConfigManager(ctx, cfgm)
if err := cmd.ParseFlags(os.Args[1:]); err == nil {
cmd.DisableFlagParsing = true
}

// Configure the log level
logger := logrus.New()
formatter := new(log.TextFormatter)
formatter.ForceColors = true
formatter.ForceFormatting = true
formatter.FullTimestamp = true
formatter.DisableTimestamp = true
logger.Formatter = formatter

if lvl, err := logrus.ParseLevel(cfgm.Config.LogLevel); err == nil {
logger.SetLevel(lvl)
}
Expand Down

0 comments on commit bf978f5

Please sign in to comment.