-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return logs when using the 'show tx' command #309
Comments
ApplicationLogs are based on the ApplicationExecuted class, which don't include logs and are not persisted (and thus cannot be retrieved). They are shown in the console when executing which is where they should be able to read them. I don't think logs should be persisted, that's not the purpose of a log as defined in the core project. We have notifications for that (which are persisted). For debugging they should really look at the neo-express console or better, use |
Hi @ixje , |
I understand that a lot of people for better or worse use print statements for debugging. Why is looking at the |
It's because we are not looking at the neo-express console. We are examining the transaction. One of the biggest problems in the developer experience is that the state needs to persist across multiple calls. We built a new VS Code extension that solves that. However, one thing we still need is the print statements. We are using 'notify' for now. The main issue is that the behavior differs when debugging vs running the transaction. This makes the development experience confusing. You just debugged and saw the print. Now you invoke the method, and it doesn't show the print? |
Can you elaborate what this means? I thought you were debugging code 🤔
It sounds like it does but they're looking in the wrong place where it prints |
I'm not debugging. I'm just running the code. Please check the video. 2023-11-08.13-15-42.mp4 |
I don't know what this plugin is or which old plugin it replaces. Does it replace neo-visual-tracker? |
It's not a plugin; it's a new VS Code extension. The plugin I refer to is one to enable the 'log' calls to be stored in a transaction as 'debug' logs. This extension is not meant to be a visual tracker but to facilitate user onboarding.
In this example, I'm calling the balanceOf method. Callbacks like |
Here is the Ghost Market NEP-11 example using a tweak to enable prints: |
It looks interesting 👀 |
That isn't the right way to do it. That You should be using |
A |
When that needs to be fixed than. 😸 |
This is what i have so far let me know if it's suitable for you. This is going to require to update RPC Server plugin. I dont think that will happen, Because this is an interface change. But we will see. {
"transaction": {
"hash": "0xb9203e4f28c5e07eef0bc5e225a2603cc7f4ba0bba8ba04f048750ac7f8ba590",
"size": 205,
"version": 0,
"nonce": 640966548,
"sender": "NbGJ2PMcd7DeVYCnAf3neEuEqgLdaGX6rP",
"sysfee": "2645280",
"netfee": "1188520",
"validuntilblock": 5876,
"signers": [
{
"account": "0xf114fa11a19cb02299010fe5a5a0518179ee61a8",
"scopes": "CalledByEntry"
}
],
"attributes": [],
"script": "DAVDaHJpcxHAHwwIc2F5SGVsbG8MFAIXhEkqUKHxhCwG7sF2B8byqmlBQWJ9W1I=",
"witnesses": [
{
"invocation": "DEDejoY2ixnHQmejF6Yc6NsnIrHOHRMGk4l5mDvO/FYKhSMcYR/KeU51nTncemMJEPAm98UI9cVptQldeVvqikew",
"verification": "DCECJJjt3o9js9i1pEOyfB7alrHtZ+v7Pu1Xx736tD2VS3dBVuezJw=="
}
]
},
"application-log": {
"txid": "0xb9203e4f28c5e07eef0bc5e225a2603cc7f4ba0bba8ba04f048750ac7f8ba590",
"executions": [
{
"trigger": "Application",
"vmstate": "HALT",
"exception": null,
"gasconsumed": "2645280",
"stack": [
{
"type": "ByteString",
"value": "SGVsbG8sIENocmlz"
}
],
"notifications": [],
"logs": [
{
"contract": "0x4169aaf2c60776c1ee062c84f1a1502a49841702",
"message": "Hello, Chris"
}
]
}
]
}
} |
Thanks a lot @cschuchardt88 , this will solve the issue! |
Looks like they are going to allow the change. But after monorepo is built. Now |
Will it work if we compile it locally? That will do for us, at least for now. We are using the standalone version of Neo Express |
If you are talking about |
@lock9 |
Resolved |
Problem:
Neo Express returns a JSON transaction when you use the show command. However, it doesn't return the 'logs'. The problem is that developers often use the 'print' (log) method to help them debug their code. Notifications are being included in the response but not the logs.
Solution:
Include the logs in the response.
The text was updated successfully, but these errors were encountered: