Hey guys! how do you see log in ayon during addon development. I tried this part of code but it doesnt seem to work, im confused on where to look. (i ran ayon using --debug --use-dev)
Logger.get_logger().info("Test Log....")
after that I tried this, but still no success
os.environ["AYON_DEBUG"] = "1"
os.environ["AYON_LOG_LEVEL"] = "10"
log = Logger.get_logger("MultipleTexturesCreator")
log.warning("Test Log....")
Try running ayon_console, with the same arguments! That shows you every logged message.
It’s in the same folder as your regular ayon launcher executable.
If you want to specify a bundle i’d recommend adding --bundle <bundle name>
but the way you configured it should pick up the dev bubdle you’ve assigned to yourself.
I hope this helps out,
Sas
1 Like
This question can have multiple meaning depending on what, where and maybe when you want to log.
e.g.
- Sometimes, it can refer to the application launch log, as mentioned in this community post.
- Other times, it might mean you want to display the published plugins report, which is logged in the
details
tab.
- It can also refer to the services log, as explained in this guide.
- Additionally, it might mean the server log, including both the addon server side and frontend part, as mentioned in this guide.
From your example, I assume MultipleTexturesCreator
is a creator plugin.
For reference, all creator plugins have log
class attribute, so you can use self.log
inside the class functions.
Additionally, here’s an example.
I ran it in Houdini’s script editor:
from ayon_core.lib import Logger
logger = Logger.get_logger()
logger.setLevel(10)
logger.debug(logger)
logger = Logger.get_logger("CreateAlembicCamera")
logger.info(logger)
Output:
- { __main__ }: [ <Logger __main__ (DEBUG)> ]
>>> [ <Logger CreateAlembicCamera (INFO)> ]
1 Like
Thanks for the detailed explanation. yeah you’re right this is a creator plugin. I had the log statement inside the creator script, so it was actually showing up in the details panel of the publisher report. I’m just trying to get the log to appear in the ayon-console. I was short on time, so I did a quick workaround and wrote the log to a text file on the desktop