Giter Site home page Giter Site logo

Comments (7)

mbrandenburger avatar mbrandenburger commented on June 15, 2024

here we have the reference shim we need to follow. https://github.com/hyperledger/fabric/blob/13447bf5ead693f07285ce63a1903c5d0d25f096/core/chaincode/shim/interfaces_stable.go

I guess what you are supposing is, that we want to extend the shim in a way that the chaincode developer can perform logging easily.

Currently, a chaincode developer can just include common/logging.h and use LOG_DEBUG, LOG_INFO, and LOG_ERROR.

from fabric-private-chaincode.

g2flyer avatar g2flyer commented on June 15, 2024

Clearly we don't want to add new bell's and whistle for logging, just (a) i think FPC chaincode should only use services from shim.h when interacting with infrastructure and (b) the logging namespace should be separated between logging done by the shim itself vs logging done by the FPC chaincode.

from fabric-private-chaincode.

mbrandenburger avatar mbrandenburger commented on June 15, 2024

yes, this sounds right to me

from fabric-private-chaincode.

g2flyer avatar g2flyer commented on June 15, 2024

Note PR #137 added some (tentative) function prototypes to shim.h but no implementation yet ..

from fabric-private-chaincode.

g2flyer avatar g2flyer commented on June 15, 2024

Observations on #137 prototypes by Marcus ...

Seems this is aligned with Fabric 1.4.x. This is good.

In Fabric 2.0, however, chaincode logging is the responsibility by the chaincode developer.
https://hyperledger-fabric.readthedocs.io/en/master/logging-control.html

Since this is not easily possible with FPC I still think its a good idea to provide this logging to the user. I believe we can only reduce the number of different log levels we want to support. Maybe just ERROR | WARNING | INFO | DEBUG ?

We definitely still should have logging-level edl functions as eventually with our own untrusted stub/shim we still want to be able to route (trusted) shim log-messages to peer. Given that we do not really have a full libc available, i think we also still would have to provide some logging functionality to user, but then on untrusted side might just throw it directly to stdout (rather than as right now to logger which then passes it to stdout ..)

from fabric-private-chaincode.

g2flyer avatar g2flyer commented on June 15, 2024

This might be semi-obsolete for fabric v2 as chaincode logging completely disappeared and everything is "punted" to stdout/stderr. Although given that by default an enclave doesn't have stdout/stderr, we might though still have some "official" debug api (or at least officially promote printing to stdout/stderr to shim.h?

from fabric-private-chaincode.

mbrandenburger avatar mbrandenburger commented on June 15, 2024

This might be semi-obsolete for fabric v2 as chaincode logging completely disappeared and everything is "punted" to stdout/stderr. Although given that by default an enclave doesn't have stdout/stderr, we might though still have some "official" debug api (or at least officially promote printing to stdout/stderr to shim.h?

ack - FPC should provide a simple logging API for debugging. I would say keeping logging.h and give FPC chaincode developers the chance to include it whenever they need it.

from fabric-private-chaincode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.