-
Notifications
You must be signed in to change notification settings - Fork 41
Improve logging/tracing for actions #325
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
Conversation
|
Please note that I only introduce deriving to |
p2p/src/network/kad/bootstrap/p2p_network_kad_bootstrap_actions.rs
Outdated
Show resolved
Hide resolved
tizoc
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.
Not a thorough review of the code, just a high level skimming of the diff + testing the node from this branch. LGTM.
What would be required to support dynamic filtering? (lets say I am interesting on a specific set of actions and I don't want to enable full tracing which would add lots of noise)
Well, filtering is quite easy thing to do. What is more difficult, is to configure it: should we filter e.g. basing on a pattern against action kind? And another thing, do you know what will you be interested in before running a node? I don't, usually. I think having the full log will be safer option, that will allow further filtering. Still this is IMHO. |
yes
no, which also brings another point: what I would also like is to be able to perform a retroactive search on stuff that has already happened but was not being printed. So more than logging itself this would be about having a saved trace that I can filter. So one solution that would cover all cases could be as simple as producing a trace-level log to a file (or pipe) without affecting the stdout one. Then that file can be filtered out with the usual tools. |
I've been thinking about this. Like OCaml node has, different options --log-level and --file-log-level. |
dce378e to
2d5d07f
Compare
|
@akoptelov just noticed that a huge plus of the doc-comment as summary feature is documentation for free |
|
Regarding #327, there may be potential for including information about filtered out actions (even if minimal) for which the enabling condition returned false when using tracing (or debug?) level file backed logging. |
adonagy
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!
About the state not being present the logging code. In the vrf evaluator it was mostly used to debug it during development and it slipped trough. IMO in respect to logging it's not hugely important to log some part of the state so I think we can omit it altogether. It could be useful on errors, but we can just dispatch an Error action and log there.
Yeah, if for some case it is important to have some part of the state logged, it can be done via separate logging statement. |
Well, probably the next step would be to revisit logging even more. At the beginning I was thinking that we can use the following approach:
This just doesn't work with To extend the logging, we might either introduce its support in So there is still much to do ) |
2d5d07f to
cb3f37b
Compare
3f71131 to
1d02974
Compare
|
@akoptelov for what I had in mind, refux-rs would just have an user configurable hook that would be called with the action as argument whenever |
matchfor all actionsNote that with this we're losing possibility to access node's state in logging code, before it has been used in several actions related to ledger sync and vrf evaluation. Some tricky DE should be used to pass store or state reference, which I didn't figure out yet.
fixes: #320
re: #321