Writing to the output console

Maybe I’m just stupid… I am having a really hard time debugging my application by writing to the output console in the designer. I am literally following the instructions presented in the docs (Output Console - Ignition User Manual 8.1 - Ignition Documentation) and using a print statement to try to determine why a tag isn’t firing. I have the console opened and just tried putting a

print "here"

in a valuedChanged event that I know works since it is using system.perscpective.print to write to the browser and those messages are being shown in output console, however my print statement isn’t. What am I doing wrong? Why is it so difficult to debug these applications?

If you’re putting that print statement in the valueChanged event on a tag then that is actually happening in the gateway scope, not the designer scope. That might be the case with perspective too… I’m not sure. So you’ll have to create a logger to log to the gateway console. I would try that and see if your logger message appears in the gateway logs.

https://docs.inductiveautomation.com/display/DOC80/system.util.getLogger

3 Likes

How can I see the gateway log from my designer or do I actually have to log into the gateway?

Yeah, you would have to log into the gateway and go to status–>Logs to see it. You can just search for the name of your logger if that’s all you want to see.

Thank you for your help, that solved my problem. I will say though that that it absolutely horrible. I should be able to fully debug my application from the designer and not have to go onto the gateway for anything. If I didn’t have access to the gateway, I would be lost. This really needs to be addressed in a future version as debugging applications has been a horrible experience.

1 Like

Unfortunately thats the setup. You’re running a gateway script so it runs on the gateway, you’re designer is not running it. Maybe being able to view logs in designer might be helpful, but there’s no way around the fact that you must log instead of print on gateway scripts and it’s not an ignition thing.

For any server software, if you have the server running a script you most likely have it log the success/failure to your logs instead of printing and then view what happened in your logs.

When the time comes to troubleshoot down the line too, you’ll be happy to have a history of your scripts successes/errors, instead of just printed to a console and then lost.

1 Like

Luckily, there’s an app for that. :wink:

Make a blank project and import the project and tags into it. This is so you don’t accidentally overwrite any gateway scripts in your original project.

Wrapper_2021-04-28_1126.zip (18.8 KB)
wrapperLogTags.json (64.1 KB)

Nick doesn’t do Ignition anymore, but here’s an archived link to describe the project.
https://web.archive.org/web/20150719075238/http://nickmudge.info/post/view-the-ignition-wrapper.log-file-in-the-designer-or-client

5 Likes

Ahhh, I wondered where he disappeared to! His name was everywhere years ago and then he just vanished one day