32 from logging.handlers
import RotatingFileHandler
33 from classes
import info
39 def __init__(self, logger, log_level=logging.INFO):
45 for line
in buf.rstrip().splitlines():
46 self.logger.log(self.
log_level, line.rstrip())
55 logging.basicConfig(format=
"%(module)12s:%(levelname)s %(message)s",
60 formatter = logging.Formatter(
'%(module)12s:%(levelname)s %(message)s')
63 log = logging.getLogger(
'OpenShot')
64 log.setLevel(logging.INFO)
67 fh = RotatingFileHandler(
68 os.path.join(info.USER_PATH,
'openshot-qt.log'), encoding=
"utf-8", maxBytes=25*1024*1024, backupCount=3)
69 fh.setFormatter(formatter)
75 if not getattr(sys,
'frozen',
False):
Custom class to log all stdout and stderr streams (from libopenshot / and other libraries) ...
def reroute_output
Route stdout and stderr to logger (custom handler)