I added a line debug alice trying to print the party alice but it doesn’t appear after executing the above command. I wonder if I need to change the log level or anything I have missed. Thanks
Do you have debug alice within a choice, i.e., in an Update or in the Script part? The latter should get printed. If you have it in a choice however, that code is executed in the ledger not by the script runner so you need to look at the ledger logs. It should be logged at debug level iirc.
Hi @chunlokling-da1. I’m trying to reproduce this issue on my machine, but I do get the expected debug output. These are the steps I’m following, please let me know if they differ from yours to help diagnose the issue:
Create a project based on the quickstart-java template and cd into it:
daml new daml-script-debug --template=quickstart-java
cd daml-script-debug
Edit daml/Main.daml so it prints the value of alice : Party using debug:
printf '14a\n debug alice\n.\nw\n' | ed -s daml/Main.daml
Build the dar, start the sandbox and upload dar to it:
My first guess of what’s happening here is that you added the debug alice line after uploading the .dar to the ledger, in which case it would make sense that the debug output is missing, since the copy of the script available to the ledger would be the one in the uploaded dar, without the debug alice line.
EDIT: I tested this on the following SDK versions, all with the expected output: