Re: Hyperledger Fabric javascript : i need help for using javascript logging in your code assetTransfer.js


MEUNIER Yannick
 

Hello Mattew,

 

Thanks for your answer.

As i am a beginner with nodejs, I’m not sure to understand your comments.

And by searching  in Node.js documentation, I don’t find the solution to my problem.

So I send you 2 files attached to this mail:

  1. assetTransfer.js which is the file coming with your package: I have just added inside CreateAsset function:
  1. console.info(`INFO YAM CreateAsset`); // to try to create a trace on my linux terminal
  2. fs.appendFileSync(`YAM.txt`, `SALUT`) //  to try to create a trace in a new file named YAM.txt
  1. trace-23_03_2022.txt : this is the trace of all my commands I launch to do my test (see lines 771 and 785)

 

My 2 problems are:

  1. I get no log trace `INFO YAM CreateAsset` with console.info on my linux terminal
  2. No trace file  YAM.txt  is created with  fs.appendFileSync  

 

So my question is:

Do I have to add something in my code to make work these 2 kinds of traces (on my terminal and in a trace file)?

 

I hope these elements will help you to solve my 2 problems.

If you need others information’s, please tell me which or what commands you want me to launch in my terminal.

 

Thanks you in advance.

 

Best regards.

 

Yannick.

 

 

De : Matthew White <WHITEMAT@...>
Envoyé : mercredi 23 mars 2022 09:39
À : MEUNIER Yannick via lists.hyperledger.org <yannick.meunier=capgemini.com@...>; fabric@...; fabric+help@...; MEUNIER, Yannick <yannick.meunier@...>
Objet : Re: Hyperledger Fabric javascript : i need help for using javascript logging in your code assetTransfer.js

 

This mail has been sent from an external source

 

 

Hello, just to confirm have you looked in the container that is running the chaincode.   It's a separate docker container.

 

The Winston logger that the chaincode libraries use is also available via the context argument on transaction functions.

 

Check the Node.js API docs for info

 

Matthew


From: fabric@... <fabric@...> on behalf of MEUNIER Yannick via lists.hyperledger.org <yannick.meunier=capgemini.com@...>
Sent: 22 March 2022 10:08
To: fabric@... <fabric@...>; fabric+help@... <fabric+help@...>; MEUNIER, Yannick <yannick.meunier@...>
Subject: [EXTERNAL] [Hyperledger Fabric] Hyperledger Fabric javascript : i need help for using javascript logging in your code assetTransfer.js

 

Hello, I use /fabric-samples/asset-transfer-basic/chaincode-javascript/lib/assetTransfer.js coming from your package But my problem is : The javascript instruction console.info or console.log doesn’t produce any trace on my linux terminal. ZjQcmQRYFpfptBannerStart

This Message Is From an External Sender

This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd

Hello,

 

I use /fabric-samples/asset-transfer-basic/chaincode-javascript/lib/assetTransfer.js coming from your package

 

But my problem is :

The javascript instruction console.info or console.log doesn’t produce any trace on my linux terminal.

How can I solve this problem please ?

If possible, i'd like also put my code traces in a text file with this instruction console.log, but how do that ?

 

Thanks in advance.

 

yannick.meunier@...

 

This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.

Join fabric@lists.hyperledger.org to automatically receive all group messages.