diff --git a/cmd/ba/main.go b/cmd/ba/main.go index d458c11..7fb9e87 100644 --- a/cmd/ba/main.go +++ b/cmd/ba/main.go @@ -91,6 +91,7 @@ func makeapp() *cli.App { cli.StringFlag{Name: "map", Value: "hexagon", Usage: "Name of the map used by the trainer"}, cli.BoolFlag{Name: "no-browser", Usage: "Disable automatic browser opening at start"}, cli.BoolFlag{Name: "debug", Usage: "Enable debug logging"}, + cli.BoolFlag{Name: "quiet", Usage: "Decrease verbosity of the output"}, cli.BoolFlag{Name: "profile", Usage: "Enable execution profiling"}, cli.BoolFlag{Name: "dump-raw-comm", Usage: "Dump all the communication between the agent and the server"}, cli.IntFlag{Name: "duration", Usage: "If set, game will stop after this durarion (in seconds)"}, @@ -105,6 +106,7 @@ func makeapp() *cli.App { mapName := c.String("map") nobrowser := c.Bool("no-browser") isDebug := c.Bool("debug") + isQuiet := c.Bool("quiet") shouldProfile := c.Bool("profile") dumpRaw := c.Bool("dump-raw-comm") duration := c.Int("duration") @@ -118,6 +120,7 @@ func makeapp() *cli.App { recordFile, agents, isDebug, + isQuiet, mapName, shouldProfile, dumpRaw, diff --git a/subcommand/train/main.go b/subcommand/train/main.go index 8837e4a..29abc6f 100644 --- a/subcommand/train/main.go +++ b/subcommand/train/main.go @@ -60,6 +60,7 @@ func TrainAction( recordFile string, agentimages []string, isDebug bool, + isQuiet bool, mapName string, shouldProfile, dumpRaw bool, @@ -156,13 +157,17 @@ func TrainAction( switch t := msg.(type) { case arenaserver.EventStatusGameUpdate: - fmt.Printf(GameColor("[game] %s\n"), t.Status) + if !isQuiet { + fmt.Printf(GameColor("[game] %s\n"), t.Status) + } case arenaserver.EventAgentLog: fmt.Printf(AgentColor("[agent] %s\n"), t.Value) case arenaserver.EventLog: - fmt.Printf(LogColor("[log] %s\n"), t.Value) + if !isQuiet { + fmt.Printf(LogColor("[log] %s\n"), t.Value) + } case arenaserver.EventDebug: debug(t.Value)