agent: log error when agent crashes in an early stage (#7411)

This commit is contained in:
Johannes Scheuermann 2020-03-09 10:45:21 +01:00 committed by GitHub
parent 40e632a955
commit bc87976708
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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
}
@ -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