Show
Ignore:
Timestamp:
11/23/08 15:39:52 (15 years ago)
Author:
arnonym
Message:

Add two logging-handlers: One to log to the statusbar (INFO and higher) and one to log to a textwidget. Which is included as a dock-widget.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/mixer-qt4/ffado-mixer.in

    r1435 r1481  
    4444from ffado_panelmanager import PanelManager 
    4545 
     46from ffado_logginghandler import * 
     47 
    4648"""Just a small helper to ask the retry-question without a blocking messagebox""" 
    4749class StartDialog(QWidget): 
     
    5557        self.layout.addWidget(self.button, 1, 0, Qt.AlignCenter) 
    5658 
    57  
    5859class FFADOWindow(QMainWindow): 
    5960    def __init__(self, parent): 
    6061        QMainWindow.__init__(self, parent) 
     62 
     63        self.textlogger = QTextLogger(self) 
     64        dock = QDockWidget("Log Messages",self) 
     65        dock.setWidget(self.textlogger) 
     66        logging.getLogger('').addHandler(self.textlogger) 
     67        self.addDockWidget(Qt.BottomDockWidgetArea, dock) 
     68 
     69        self.statuslogger = QStatusLogger(self, self.statusBar(), 20) 
     70        logging.getLogger('').addHandler(self.statuslogger) 
    6171 
    6272        self.manager = PanelManager(self) 
     
    8696        helpmenu.addAction( aboutqtaction ) 
    8797 
    88         self.statusBar().showMessage( "Initializing...", 5000
     98        log.info( "Starting up"
    8999 
    90100        QTimer.singleShot( 1, self.connectToDBUS ) 
     
    94104            self.setupDeviceManager() 
    95105        except dbus.DBusException, ex: 
    96             log.error("") 
    97             log.error("") 
    98             log.error("===========================================================") 
    99             log.error("ERROR: Could not communicate with the FFADO DBus service...") 
    100             log.error("===========================================================") 
    101             log.error("") 
    102             log.error("") 
     106            log.error("Could not communicate with the FFADO DBus service...") 
    103107            if not hasattr(self,"retry"): 
    104108                self.retry = StartDialog(self) 
     
    143147    #set up logging 
    144148    import logging 
    145     logging.basicConfig(
     149    logging.basicConfig( datefmt="%H:%M:%S", format="%(asctime)s %(name)-16s %(levelname)-8s %(message)s"
    146150 
    147151    if DEBUG: