Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Internalize util logger #73

Merged
merged 1 commit into from
Jun 2, 2020
Merged

Internalize util logger #73

merged 1 commit into from
Jun 2, 2020

Conversation

holgerd77
Copy link
Member

@holgerd77 holgerd77 commented Jun 2, 2020

The 'devp2p:util' logger was always a bit of an alien with no semantics, being used for logging output from the generic assertEq function. This lead to the case that a) errors are not associated to a corresponding logger and therefore are more difficult to track and b) not logged at all when not using 'devp2p:*' but a selected logger like 'devp2p:rlpx'.

This PR fixes this and removes the 'devp2p:util' logger. A logger ('debug') is instead passed to the 'assertEq' method from the respective modules and the error gets logged in a context-aware manner.

Example:

  devp2p:rlpx:peer Received header 88.99.67.109:30303 +1ms
  devp2p:rlpx:peer Received body 88.99.67.109:30303 01c104 +0ms
  devp2p:rlpx:peer Received DISCONNECT (message code: 1 - 0 = 1) 88.99.67.109:30303 +0ms
  devp2p:rlpx refill connections.. queue size: 1, open slots: 11 +1ms
  devp2p:rlpx:peer [ERROR] wrong ecies header (possible cause: EIP8 upgrade): 01 / 04 +2ms
  devp2p:rlpx:peer Received ack (EIP8) from 147.135.182.139:30303 +2ms
  devp2p:rlpx:peer Send HELLO to 147.135.182.139:30303 +0ms
  devp2p:rlpx:peer Received body 54.39.51.192:30303 14fa010aa2f90215a0937afb3fa16cf335836f9345652bdb58787f444add... +14ms
  devp2p:rlpx:peer Received undefined (message code: 20 - 16 = 4) 54.39.51.192:30303 +1ms

@holgerd77 holgerd77 force-pushed the improve-debug-output branch from 07b443d to 4061955 Compare June 2, 2020 15:02
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 87.514% when pulling 4061955 on improve-debug-output into fd8a10c on master.

Copy link
Contributor

@ryanio ryanio left a comment

Choose a reason for hiding this comment

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

nice, looks good

@holgerd77 holgerd77 merged commit 5664ef6 into master Jun 2, 2020
@holgerd77 holgerd77 deleted the improve-debug-output branch June 2, 2020 18:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants