caliper icon indicating copy to clipboard operation
caliper copied to clipboard

Make logging consistent

Open nklincoln opened this issue 6 years ago • 14 comments

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)

nklincoln avatar Jul 31 '19 10:07 nklincoln

Hey I would like to contribute to Caliper, starting with this issue.

0xamogh avatar Nov 28 '19 16:11 0xamogh

@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

aklenik avatar Nov 29 '19 10:11 aklenik

Thanks, I'll do that!

0xamogh avatar Nov 29 '19 11:11 0xamogh

Hey, may I begin?

0xamogh avatar Dec 20 '19 18:12 0xamogh

@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.

aklenik avatar Jan 08 '20 13:01 aklenik

Okay, thanks, if I have some queries where can I discuss them? Is there a community channel for this project?

0xamogh avatar Jan 08 '20 19:01 0xamogh

@amogh-jrules Yes, see the Communication section of this page: https://wiki.hyperledger.org/display/caliper

aklenik avatar Jan 09 '20 11:01 aklenik

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.

0xt3j4s avatar May 01 '22 07:05 0xt3j4s

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

aklenik avatar May 02 '22 09:05 aklenik

Ok. Thank you!

Checked CONTRIBUTING.md,

0xt3j4s avatar May 05 '22 01:05 0xt3j4s

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.

0xt3j4s avatar May 11 '22 13:05 0xt3j4s

@Tezas-6174 That sounds like a good workflow. Correcting error message per package sounds reasonable

aklenik avatar May 11 '22 14:05 aklenik

Yes. So now, I will start by working on caliper-cli package following the above workflow.

Thank you.

0xt3j4s avatar May 12 '22 01:05 0xt3j4s