说明
python logredirector示例是从最受好评的开源项目中提取的实现代码,你可以参考下面示例的使用方式。
编程语言: Python
命名空间/包名称: outwikercorelogredirector
示例#1文件:
runoutwiker.py项目:
mcseemka/outwiker
def OnInit (self):
getOS().migrateConfig()
self._fullConfigPath = getConfigPath ()
Application.init(self._fullConfigPath)
try:
starter = Starter()
starter.processConsole()
except StarterExit:
return True
redirector = LogRedirector (self.getLogFileName (self._fullConfigPath))
redirector.init()
from outwiker.gui.mainwindow import MainWindow
self.mainWnd = MainWindow(None, -1, "")
self.SetTopWindow (self.mainWnd)
Application.mainWindow = self.mainWnd
Application.actionController = ActionController (self.mainWnd, Application.config)
registerActions(Application)
self.mainWnd.createGui()
Application.plugins.load (getPluginsDirList())
self.bindActivateApp()
self.Bind (wx.EVT_QUERY_END_SESSION, self._onEndSession)
starter.processGUI()
return True
示例#2文件:
owapplication.py项目:
Jenyay/outwiker
def initLogger(self, debugMode=False):
level = logging.DEBUG if debugMode else logging.WARNING
redirector = LogRedirector(
self.getLogFileName(self._application.fullConfigPath),
level)
redirector.init()
wx.Log.SetLogLevel(0)
示例#3
def OnInit(self):
getOS().init()
getOS().migrateConfig()
self._fullConfigPath = getConfigPath()
Application.init(self._fullConfigPath)
self._locale = wx.Locale(wx.LANGUAGE_DEFAULT)
try:
starter = Starter()
starter.processConsole()
except StarterExit:
return True
if APP_DATA_DEBUG not in Application.sharedData:
config = GeneralGuiConfig(Application.config)
Application.sharedData[APP_DATA_DEBUG] = config.debug.value
level = (logging.INFO
if Application.sharedData.get(APP_DATA_DEBUG, False)
else logging.WARNING)
redirector = LogRedirector(self.getLogFileName(self._fullConfigPath),
level)
redirector.init()
wx.Log.SetLogLevel(0)
from outwiker.gui.mainwindow import MainWindow
self.mainWnd = MainWindow(None, -1, "")
self.SetTopWindow(self.mainWnd)
Application.mainWindow = self.mainWnd
Application.actionController = ActionController(self.mainWnd,
Application.config)
registerActions(Application)
self.mainWnd.createGui()
Application.plugins.load(getPluginsDirList())
self.bindActivateApp()
self.Bind(wx.EVT_QUERY_END_SESSION, self._onEndSession)
starter.processGUI()
return True