-
Notifications
You must be signed in to change notification settings - Fork 16
knode/validator: context logger w/ custom handlers; replaced log.Warn w/ log.Crit if sync fails #818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
client/knode/validator/validator.go
Outdated
| txConfirmationTimeout = 10 * time.Second | ||
|
|
||
| // log handlers | ||
| fileHandler = log.Must.FileHandler("/var/log/validator_all.log", log.LogfmtFormat()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can break non-unix clients or clients with no access to /var/log
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, this needs to be configurable and passed down from main comand
| func (val *validator) sync() { | ||
| if err := SyncWaiter(val.eventMux); err != nil { | ||
| log.Warn("Failed to sync with network", "err", err) | ||
| val.logger.Crit("Failed to sync with network", "err", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this now Critical?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we can't start the validation without syncing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that doesn't mean we should kill the client, can we return nil or not starting vlidation process
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current flow is a one shot type of thing and we will need to modify the flow to take that into account. I will open a separate issue for that problem.
JekaMas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Closes #817