-
Notifications
You must be signed in to change notification settings - Fork 174
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
[sozo] add trace logs #1867
[sozo] add trace logs #1867
Conversation
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.
Thanks for working on this!
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.
Great work @btirth!
As @tarrencev mentioned, we should use structured logging everywhere.
You have the good convention with the LOG_TARGET
, now you'll have to switch to the correct format where the text should be a sentence with a capital letter and punctuation.
And for the variables, you have to assign them depending on what should be printed.
If you have any question, please let's know. You can find several examples of this structured logging into the code base already.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1867 +/- ##
==========================================
- Coverage 70.28% 70.13% -0.15%
==========================================
Files 315 315
Lines 35864 35993 +129
==========================================
+ Hits 25206 25244 +38
- Misses 10658 10749 +91 ☔ View full report in Codecov by Sentry. |
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.
Thanks for the work here!
Some other comments.
Also, it seems that your editor is always removing empty line at the end of the files. It's preferable to have this new line at the end of the file.
Co-authored-by: glihm <dev@glihm.net>
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 dont think we have to insert log for every stuff we're doing. it's only gonna introduce noise than actually useful info. i have sugggested some places where the logs can be removed.
besides, individual event logs arent particularly useful, i think its better to use spans wherever make sense instead (eg on the commands' main execution point)
wdyt @tarrencev @glihm ?
Co-authored-by: Ammar Arif <evergreenkary@gmail.com>
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.
thanks for the contribution!
i have few suggestion:
- i dont think we need to manually specify
LOG_TARGET
by default the package name would be used which i think is good - for things like
signer
,world_address
, which are static we should print them each in a single line (and preferrably during the beginning of execution) so they are easier to find.
@lambda-0x Thank you for your suggestions.
|
I think katana benefits from having a for sozo its not very useful since since we would need to manage them whenever doing any kind of refactor.
i meant we should have a trace for each one of them in the beginning of sozo execution since they are static and wont change once they are calcuated (for e.g. world address if user hasn't specified it we take it from `Scarb.toml). |
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.
Could you please double check that fetched
is only used when something is actually fetched from the network.
I've made some modifications in Events
, but may have missed some.
Co-authored-by: glihm <dev@glihm.net>
Are any changes required or can we merge this one? |
@btirth can you please take a look at CI failures, try running the command they run locally. |
@lambda-0x: I've fixed CI failures. |
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.
Thanks for your patience and iteration @btirth!
I you could address the latest comments, will merge after that. Great work!
Co-authored-by: glihm <dev@glihm.net>
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.
@btirth thanks for the work here!
Added trace logs for Sozo.
Closes #1409
Closes DOJ-160