-
Notifications
You must be signed in to change notification settings - Fork 212
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
Clean up logging #5582
Clean up logging #5582
Conversation
Reduce the default log level to something manageable for a normal user, so that they have a sense of what's actually going on Reduce libp2p log level
@@ -110,6 +112,7 @@ func (f *Fetch) getHashes( | |||
} | |||
|
|||
eg.Wait() | |||
f.logger.WithContext(ctx).With().Info("finished fetching hash objects") |
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.
IMO this it debug
@@ -68,6 +68,8 @@ func (f *Fetch) getHashes( | |||
|
|||
var eg errgroup.Group | |||
var failed atomic.Uint64 | |||
f.logger.WithContext(ctx).With().Info("attempting to fetch hash objects", |
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.
IMO debug too.
@@ -387,7 +387,7 @@ func (pb *ProposalBuilder) decideMeshHash(ctx context.Context, current types.Lay | |||
} | |||
|
|||
func (pb *ProposalBuilder) UpdateActiveSet(epoch types.EpochID, activeSet []types.ATXID) { | |||
pb.logger.With().Info("received activeset update", | |||
pb.logger.With().Debug("received activeset update", |
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 one IMO is Info because it's the centralized update.
|
||
// our p2p code logs at the default level (Info), but we want the lower level libp2p logging | ||
// to be less verbose | ||
cfg.LogLevel = zapcore.WarnLevel |
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's configurable; why not change the default config instead? Sometimes we really need to set it.
@@ -409,7 +409,7 @@ func (fh *Host) trackNetEvents() error { | |||
return nil | |||
} | |||
natEv := ev.(event.EvtNATDeviceTypeChanged) | |||
fh.logger.With().Info("NAT type changed", | |||
fh.logger.With().Debug("NAT type changed", |
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.
Will be hard to detect what's wrong when we hide it with Debug.
d.logger.WithContext(ctx).With().Info("fetching missing epoch atxs", | ||
epoch, | ||
log.Stringer("peer", peer), | ||
log.Int("total", len(ed.AtxIDs)), |
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.
afaik, this total is not the absolute total, so we need to be careful here.
maybe @dshulyak can point to more, but I remember that I had a similar idea some time ago, and that's how I remembered.
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.
i think this is from epoch info response, so in this case this is how many atxs are available from that peer. definitely not absolute, and not even how many are available locally
ed, err := d.fetcher.PeerEpochInfo(ctx, peer, epoch)
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #5582 +/- ##
=======================================
Coverage 79.6% 79.7%
=======================================
Files 270 270
Lines 27186 27203 +17
=======================================
+ Hits 21667 21684 +17
+ Misses 3973 3972 -1
- Partials 1546 1547 +1 ☔ View full report in Codecov by Sentry. |
this is stale by now, closing and will revisit these later if needed. |
Motivation
A developer should be able to tell what's going on by following the node log. This cleans up a lot of the noise in the logs and highlights important information such as sync status. No log lines are removed, but verbosity is decreased (e.g., warn -> info, info -> debug). libp2p logs in particular are moved to warn level.
Test Plan
N/A, no logic changes
TODO