I want a debug console in Anki, how to accomplish this?

For AwesomeTTS, i’d like some kind of “debug console” which the user could turn on and get detailed information about what the addon is doing, without resorting to printing on the terminal (some users don’t know how to run from the terminal). Is there something like this on github, or in the addons page perhaps ?

it’s also possible to debug your script with pdb. Place the following line somewhere in your code, and when Anki reaches that point it will kick into the debugger in the terminal:

from aqt.qt import debug; debug()

Alternatively you can export DEBUG=1 in your shell and it will kick into the debugger on an uncaught exception.

https://addon-docs.ankiweb.net/#/more?id=debugging

You can either provide them with instructions, or implement your own debug/log system in your add-on.

OK, I will look into this further and report back.

I ended up doing this: https://github.com/AwesomeTTS/awesometts-anki-addon/blob/master/awesometts/init.py#L86

not sure how clean it is, but serves my purpose as developer currently. not sure whether this is easy enough for users to use.