Skip to content

knode/validator: context logger w/ custom handlers; replaced log.Warn w/ log.Crit if sync fails#818

Open
rgeraldes wants to merge 12 commits into
devfrom
feature/knode-log
Open

knode/validator: context logger w/ custom handlers; replaced log.Warn w/ log.Crit if sync fails#818
rgeraldes wants to merge 12 commits into
devfrom
feature/knode-log

Conversation

@rgeraldes

Copy link
Copy Markdown
Contributor

Closes #817

@rgeraldes rgeraldes changed the title knode: added support for different loggers knode/validator: context logger w/ custom handlers; replaced log.Warn w/ log.Crit if sync fails Oct 8, 2018
Comment thread client/knode/validator/validator.go Outdated
txConfirmationTimeout = 10 * time.Second

// log handlers
fileHandler = log.Must.FileHandler("/var/log/validator_all.log", log.LogfmtFormat())

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

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)

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor Author

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 JekaMas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants