Make logging consistent
The current logging situation is a little bit ad-hoc. There is no enforced standard, and we would benefit greatly from a serviceability and usability point if we were to enforce logging standards across the Caliper code base.
We should be logging at debug level:
- [ ] entry/exit from every method, including passed values
We should be logging at error level
- [ ] every error thrown through the code
We should be logging at info level:
- [ ] caliper lifecycle items
- [ ] round information and basic statistics (we do this already)
Hey I would like to contribute to Caliper, starting with this issue.
@amogh-jrules Awesome! To get familiar with the logging aspects you can refer to this doc page: https://hyperledger.github.io/caliper/vNext/logging/ We're changing a LOT of the core code right now, so give us a few days to finish it, just to avoid a conflict hell :) And drop by the next Caliper call, so we can have a discussion about the logging rules/guidelines: https://github.com/hyperledger/caliper/wiki/Caliper-Calls
Thanks, I'll do that!
Hey, may I begin?
@amogh-jrules Sorry for the late reply. After PR #682 is merged, you can start working on the "master modules" in the following directory: https://github.com/hyperledger/caliper/tree/master/packages/caliper-core/lib/master
Until that time you can still inspect the different SUT adapters whether they require additional logging (probably yes). I'd recommend to start with the following adapters: Fabric, Ethereum, Sawtooth and FISCO-BCOS.
One thing to look out for: the invokeSmartContract and querySmartContract methods are considered hot paths, so they're performance critical, try not to stringify big objects during logging.
Okay, thanks, if I have some queries where can I discuss them? Is there a community channel for this project?
@amogh-jrules Yes, see the Communication section of this page: https://wiki.hyperledger.org/display/caliper
Is this issue resolved? If not can you explain a bit about the issue?
I am new to this ecosystem but would like to start with this issue if it's open. Please share some beginner-friendly resources if possible.
The issue is far from resolved, so every contribution is welcome! Check the following doc for guidelines on contributing: https://github.com/hyperledger/caliper/blob/main/CONTRIBUTING.md
Ok. Thank you!
Checked CONTRIBUTING.md,
From what I understood, I am supposed to check all the error logs for all the packages while following the above sub-tasks of the issue. So to solve this issue it may be required to create multiple PRs. As of now I am starting to work on a package say caliper-cli and then will submit it's PR. Likewise I'll check all the packages and then after merging all the PRs we can resolve this issue.
Please correct me if I am wrong.
@Tezas-6174 That sounds like a good workflow. Correcting error message per package sounds reasonable
Yes. So now, I will start by working on caliper-cli package following the above workflow.
Thank you.