I would like to get the logs (diagnostic window > console tab) from my vision client in a script. I have played around with the VisionClientContext
and its getLoggingManager
method, but haven't found anything useful yet. Does anyone know if this is possible?
1 Like
I've done this sort of thing before here:
Output Console Buffer Problems
For your use case, the code boils down to this:
from com.inductiveautomation.ignition.client.util.gui import OutputConsole
# Get an instance of the console
# Find the scroll pane,
# ...and return the text property from the internal JTextField
def getConsoleText():
console = OutputConsole.getInstance()
for component in console.components:
if hasattr(component, 'viewport'):
return component.viewport.view.text
# Get the console text, and do something with it
consoleText = getConsoleText()
3 Likes
This is exactly what I was looking for. Thank you.
1 Like