How to output debug logs from plugin?

Hey,

I have a python plugin installed, I’m editing the package content python — how do I get any kind of output/debug log to anywhere where I can check it?

I think I have my python environment set up ok, I think all the pip dependencies of the plugin are installed (at least in the macro window I can output them), I think changes in the plugin code affect something (at least deleting code all of Glyphs fails to start with an error), but I cannot figure out any way to debug what is causing the plugin to eventually not show.

I tried in the settings “Use system console for script output” but that doesn’t seem to only direct macro window output somewhere else than the macro window, but not anywhere in the Console app that I can find. print()? logging.error()? 2/0?

LogToConsole or LogError:

https://docu.glyphsapp.com/#LogToConsole

1 Like

Just put print("__a"), print("__b") … all over the place?

print() inside the plugin code doesn’t output anywhere, but LogToConsole() does, thanks.

Could Glyphs redirect any logging.error() output to LogToConsole() / the mac console? That would be more Pythonic.


Screenshot 2024-06-05 at 9.41.52