Finish logging cleanup

This commit is contained in:
Tim Bentley 2010-03-04 22:09:03 +00:00
parent 181c7c9946
commit f4e25bf329
5 changed files with 13 additions and 11 deletions

View File

@ -161,7 +161,7 @@ def main():
filename = os.path.join(get_config_directory(), u'openlp.log')
logfile = FileHandler(filename, u'w')
logfile.setFormatter(logging.Formatter(
u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s'))
u'%(asctime)s %(name)-20s %(levelname)-8s %(message)s'))
log.addHandler(logfile)
logging.addLevelName(15, u'Timer')
# Parse command line options and deal with them.

View File

@ -27,6 +27,8 @@ import logging
from PyQt4 import QtGui
log = logging.getLogger(__name__)
class OpenLPDockWidget(QtGui.QDockWidget):
"""
Custom DockWidget class to handle events
@ -40,10 +42,9 @@ class OpenLPDockWidget(QtGui.QDockWidget):
if name:
self.setObjectName(name)
self.setFloating(False)
self.log = logging.getLogger(u'OpenLPDockWidget')
self.log.debug(u'Init done')
log.debug(u'Init done')
def closeEvent(self, event):
self.parent.settingsmanager.setUIItemVisibility(
self.objectName(), False)
event.accept()
event.accept()

View File

@ -29,6 +29,8 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon
log = logging.getLogger(__name__)
class OpenLPToolbar(QtGui.QToolBar):
"""
Lots of toolbars around the place, so it makes sense to have a common way
@ -43,8 +45,7 @@ class OpenLPToolbar(QtGui.QToolBar):
self.icons = {}
self.setIconSize(QtCore.QSize(20, 20))
self.actions = {}
self.log = logging.getLogger(u'OpenLPToolbar')
self.log.debug(u'Init done')
log.debug(u'Init done')
def addToolbarButton(self, title, icon, tooltip=None, slot=None,
checkable=False):
@ -119,7 +120,7 @@ class OpenLPToolbar(QtGui.QToolBar):
if self.icons[title]:
return self.icons[title]
else:
self.log.error(u'getIconFromTitle - no icon for %s' % title)
log.error(u'getIconFromTitle - no icon for %s' % title)
return QtGui.QIcon()
def makeWidgetsInvisible(self, widgets):
@ -152,4 +153,4 @@ class OpenLPToolbar(QtGui.QToolBar):
push_button.setCheckable(True)
push_button.setFlat(True)
self.addWidget(push_button)
return push_button
return push_button

View File

@ -25,7 +25,7 @@
import logging
log = logging.getLogger(u'MediaDockManager')
log = logging.getLogger(__name__)
class MediaDockManager(object):
@ -58,4 +58,4 @@ class MediaDockManager(object):
if self.media_dock.widget(dock_index):
if self.media_dock.widget(dock_index).ConfigSection == name:
self.media_dock.widget(dock_index).hide()
self.media_dock.removeItem(dock_index)
self.media_dock.removeItem(dock_index)

View File

@ -31,7 +31,7 @@ from openlp.core.ui import GeneralTab, ThemesTab
from openlp.core.lib import Receiver
from settingsdialog import Ui_SettingsDialog
log = logging.getLogger(u'SettingsForm')
log = logging.getLogger(__name__)
class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):