-
Notifications
You must be signed in to change notification settings - Fork 138
Add debug log level and instrument important internal events #469
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
2989bd8
to
c193b01
Compare
|
@ko1 I've improved the log messages and it should be clearer now. I also adopted the "block" pattern for debug level helper. But I'm not sure if you'd like this pattern applied to other level's log helpers too? |
23724b7
to
e1118c8
Compare
I meant:
and I don't think other log messages do not need to use this technique. |
If you mean this should also be applied to other log-levels, it's essentially optimizing the logging mechanism's memory footprint. Perhaps that deserves separate PR? Also, what do you think about the current format? |
If the "current format" is fowling which on the PR description, I'm ok (and it can be modified easily).
This patch doesn't introduce block notation, so I work on it after merging it. |
Yes the description contains the updated format. |
@ko1 If you think the format is ok, I think it's ready for merge. |
I'll merge it after v1.5.0. |
When working on features that involves Session <-> ThreadClient interaction, like #422, I often put multiple puts/pp in different places to see what's happening in the debugger. And then I feel that they're mostly about:
So I figure maybe we can add the
debug
log level and instrument them in a more uniformed format. I think it'll help ourselves debug issues and also help anyone who's interested in learning the debugger internal. And in some cases, having this information can help us debugging user issues as well.Example
Let's zoom in to the logs printed after the
c
command was entered.You can see that all messages' subject are thread client objects, as most of the "actions" in the debugger happen around them. And the rest of the messages are plainly described in English so it's easy to understand, even for first-time readers.