def handle_exception(extype, value, tb): logger = logging.getLogger('cddagl') tb_io = StringIO() traceback.print_tb(tb, file=tb_io) logger.critical(_('Global error:\nLauncher version: {version}\nType: ' '{extype}\nValue: {value}\nTraceback:\n{traceback}').format( version=version, extype=str(extype), value=str(value), traceback=tb_io.getvalue())) ui_exception(extype, value, tb)