Skip to content

Commit

Permalink
agent: log error when agent crashes in an early stage (#7411)
Browse files Browse the repository at this point in the history
  • Loading branch information
johscheuer authored and freddygv committed Mar 12, 2020
1 parent 5a650ee commit 35fee6d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions command/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ func (c *cmd) run(args []string) int {
memSink, err := lib.InitTelemetry(config.Telemetry)
if err != nil {
c.logger.Error(err.Error())
logGate.Flush()
return 1
}

Expand All @@ -229,6 +230,7 @@ func (c *cmd) run(args []string) int {
agent, err := agent.New(config, c.logger)
if err != nil {
c.logger.Error("Error creating agent", "error", err)
logGate.Flush()
return 1
}
agent.LogOutput = logOutput
Expand Down

0 comments on commit 35fee6d

Please sign in to comment.