Skip to content
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

Revisiting log levels #1788

Merged
merged 3 commits into from
Oct 1, 2020
Merged

Revisiting log levels #1788

merged 3 commits into from
Oct 1, 2020

Conversation

mratsim
Copy link
Contributor

@mratsim mratsim commented Oct 1, 2020

#1779 #1785

Description/Philosophy

  • Fatal: ???
  • Error: Bugs or critical unexpected behaviors, node cannot proceed with task, consistency compromised
  • Warning: Expected behavior (file not found), node cannot proceed with task but can recover
  • Notice: Start/quit, validator funds, own attestations, own blocks, finality checkpoints, (any) slashings
  • Info: Important networking issues
  • Debug: Common networking (new peers, kick peers, timeouts), consensus stages, block/attestation validation
  • Trace: Keep-alive, routine schedule

Note: it is important not to fill disk with logs, this prevent analyzing them visually.
Logs done at high frequency should be summarized even at trace level to avoid drowning other subsystem
For example they can use an uint8 counter with

proc myHighFreqProc() =
  var counter {.threadvar.}: uint8
  if counter == 255:
    trace "Total of 255 myHighFreqProc call"
  counter += 1

For the keep alive / control message that were done by Gossipsub: https://github.com/status-im/nim-libp2p/pull/381/files

TODO

The current color of the notice level is confusing, it seems like an issue that needs to be addressed and seems to sit in-between warning and error.

image

@arnetheduck
Copy link
Member

let's also add a doc/logging.txt outlining the general strategy - in the wiki, it gets lost (or if we need to migrate from github)

@mratsim mratsim merged commit 0280d6c into devel Oct 1, 2020
@mratsim mratsim deleted the revisiting-logs branch October 1, 2020 18:56
This was referenced Oct 1, 2020
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.

3 participants