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?