[GOAL2-614] Updated algoh to capture algod logs on early termination#40
Conversation
…ates before block watcher is initialized. Fix code analysis warnings.
| genesisID, err := nc.GetGenesisID() | ||
| if err != nil { | ||
| fmt.Fprintln(os.Stdout, "error loading telemetry config", err) | ||
| _, _ = fmt.Fprintln(os.Stdout, "error loading telemetry config", err) |
There was a problem hiding this comment.
What's the purpose of the "_, _"? Were you getting lint errors or something? I think we're fine sticking with our standard convention of not doing this - unless there's a reason we need to start doing this, please don't.
There was a problem hiding this comment.
OK, Goland required to get the green check for code analysis. I will remove.
Karmastic
left a comment
There was a problem hiding this comment.
Thanks for tackling this. A few requests.
|
|
||
| // capture logs if algod terminated prior to blockWatcher starting | ||
| if !blockWatcherInitialized && algohConfig.UploadOnError { | ||
| if errorOutput.output != "" { |
There was a problem hiding this comment.
This looks like a duplicate of the code below - please consolidate. Also - this block should not all be gated by 'UploadOnError' - that should only affect whether we call sendLogs(), like below.
There was a problem hiding this comment.
OK,Refactored into a separate method collectErrorLogs(). Removed UploadOnError condition.
Removed blank identifiers.
Consolidated error logging as recommended, please re review.
Add RoundNumber to global opcode
Please review this change to capture logs In case algod terminates before block watcher initializes.