Unable to write log message into chaincode log

Dear ALL,

I want to debug my function in chaincode. I am unable to find the way the message in chaincode log message.

My code is as below:
var logger = shim.NewLogger(“chaincode”)
logger.Info(“Get all the IDs and bytes value”);

Is it the right way ? or share me the link where i can get the help to write log message properly.

If i want to print the float or string value how can i write log message for that.

I don’t know this shim package but if it has the same functions as the built in logger can you use the Infof() function to write numbers in the message. For example

logger.Infof("%s has %d items", name, count)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.