Texport Logging Level?

Using python standard Logging lib in a TouchDesigner extension … in an Execute DAT, under onStart(), I’m doing the following:

import logging from logging.handlers import RotatingFileHandler logging.basicConfig(level=logging.INFO) logger = logging.getLogger('main') handler = RotatingFileHandler("logs/MAIN/main.log", maxBytes=20000, backupCount=100) handler.setLevel(logging.INFO) logger.addHandler(handler)

… when I log events with:

logger = logging.getLogger("main") logger.info('foo')
… it prints to the textport.

But when I do it with logger.warning('bar') , it doesn’t.

I’m not sure where to set the logging level of the textport, such as it were, but I would think that if INFO level logs print that WARNING level logs would too, no?

I know the call is working because I’m seeing it in the log file generated by the file handler.

Any idea how to get my WARNING level logs into the textport as well? Or, better yet, how to set the logging level of the textport?

Maybe having two separate handlers would help. One could be dedicated to the textport and the other could be dedicated to the file output.

ch = logging.StreamHandler(sys.stdout) # console handler
ch.setLevel(logging.INFO)
logger.addHandler(ch)

David, you, sir, are the type of guy who has the answers

TouchDesigner_Shared/logging_demo.toe at master · DBraun/TouchDesigner_Shared · GitHub @Ivan I’ve put a logger tox here