def set_logging_level(self, newValue): self._logging_level = convert_string(newValue) if self._logging_level.upper() == u"CRITICAL": setGlobalLoggingLevel(logging.CRITICAL) elif self._logging_level.upper() == u"ERROR": setGlobalLoggingLevel(logging.ERROR) elif self._logging_level.upper() == u"WARNING": setGlobalLoggingLevel(logging.WARNING) elif self._logging_level.upper() == u"INFO": setGlobalLoggingLevel(logging.INFO) elif self._logging_level.upper() == u"DEBUG": setGlobalLoggingLevel(logging.DEBUG)
def prepare_application(cls, beforeCreate, factory): from PyQt4.QtGui import QApplication, QMainWindow from lunchinator import get_settings from lunchinator.log import initializeLogger from lunchinator.log.lunch_logger import setGlobalLoggingLevel from lunchinator.utilities import setValidQtParent initializeLogger() get_settings().set_verbose(True) setGlobalLoggingLevel(logging.DEBUG) app = QApplication(sys.argv) beforeCreate() window = QMainWindow() setValidQtParent(window) window.setWindowTitle("Layout Example") window.resize(300, 300) window.setCentralWidget(factory(window)) window.showNormal() window.raise_() window.activateWindow() return window, app
def initLogger(options, path=None): initializeLogger(path) if options.verbose: get_settings().set_verbose(True) setGlobalLoggingLevel(logging.DEBUG)