BlackStartx / PyCharm-Blender-Plugin

A PyCharm Plugin that simplify the development of Blender Add-On inside the PyCharm IDE.
MIT License
162 stars 14 forks source link

Is it possible to output to the console? #12

Open vts3rss opened 1 year ago

vts3rss commented 1 year ago

Thanks for your addon. Is it possible to output to the console via print? Files are updated when the text changes, but there is no printing to the console. I need functionality similar to how it is done in the addon for VSCode Windows 11 Blend-Charm.2022.3.Community.Edition Blender 3.4

BlackStartx commented 1 year ago

Hi Vts~ ^-^

This seems related to #4,

As stated there I'll post the workaround here too, you can use the python logging library.

Example:

import logging

logging.log(logging.INFO, "Hello World!")

The logging library seems to stream data to a buffer that it's handled by the console (probably stderr), while the print stream to another buffer (probably stdout) that it's not handled.

Sorry for the issue,

vts3rss commented 1 year ago

I succeeded through logging.WARN, but how to make the error output that blender itself produces?

vts3rss commented 1 year ago

is it possible to disable console redirection altogether, and activate the standard blender console?

Zexyp commented 1 year ago

is it possible to disable console redirection altogether, and activate the standard blender console?

I think it's not possible. The console output can be seen in the BlendCharm plugin window. If you really want the console to open through Blender you can just use Blender directly without starting it using the plugin.

vts3rss commented 1 year ago

Thank you

CGSeb commented 1 year ago

Hi, it seems related to the "level" of log shown by the BlendCharm console filtering the "info" log level. There is probably a setting to change this in the plugin code?

After testing the debug mode we do have all the logs in the debug mode, but not in the simple execution