-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
decoder: formatting improvements #783
Conversation
I am actually a bit unsure how to go about it. Yes, the default format logic is duplicated in knurling-rs/probe-run#425, but it is actually a bit different than in |
I'd then propose to add a no-location flag to
I think all of this logic would end up in the |
Makes sense |
7d257a0
to
c16db8f
Compare
I did a relatively big refactor of all the formatting stuff. |
Cool, thank you! I will hand over the project to a colleague this week. He will come back to you. |
cefe2d6
to
2fcaa4f
Compare
Hi @Urhengulas, do you know if your colleague will have time for some reviews soon? |
|
I'll take a look now. |
Looks good to me. It'll need a rebase to fix the CHANGELOG, and perhaps we could squash the first three commits, just for neatness. |
f1cb458
to
1237752
Compare
1237752
to
251e214
Compare
Rebased now :) |
Ping @jonathanpallant |
Besides refactoring the log formatting code, this PR introduces a few new features:
{c}
metadata specifierNow it's possible to add
{c}
to the log format in order to print the crate name. I'm currently parsing this out of the module path, there may be better ways to do this.More detailed
{f}
metadata specifiersI found the
{f}
specifier to be not very useful in most cases, mainly because a lot of files are calledmod.rs
. Now it's possible to increase how detailed to print the path to the file by adding{ff}
,{fff}
, etc... to the log format. With{ff}
the Formatter would printformat/mod.rs
instead of justmod.rs
, which I think is much more useful.Zero-padding support
I added the zero-padding functionality from #780 to this PR. Now it's possible to zero-pad metadata specifiers, such as the timestamp or the line number.