Commit c1eb5747 authored by Martin Drechsler's avatar Martin Drechsler

some logging added

parent 8729e0fd
...@@ -21,6 +21,9 @@ from measurement import MeasurementFrame ...@@ -21,6 +21,9 @@ from measurement import MeasurementFrame
import sys import sys
import numpy as np import numpy as np
import logging
LOG = logging.getLogger('Main logger')
GUI_LOG = LOG.getChild('GUI logger')
class CameraGuiMainWindow(QMainWindow): class CameraGuiMainWindow(QMainWindow):
...@@ -38,7 +41,7 @@ class CameraGuiMainWindow(QMainWindow): ...@@ -38,7 +41,7 @@ class CameraGuiMainWindow(QMainWindow):
self.initUI() self.initUI()
def initUI(self): def initUI(self):
GUI_LOG.info('Initializing gui')
self.win = QtGui.QMainWindow() self.win = QtGui.QMainWindow()
self.win.setWindowTitle("Camera GUI") self.win.setWindowTitle("Camera GUI")
self.win.setWindowIcon(QtGui.QIcon('Butter_robot.png')) self.win.setWindowIcon(QtGui.QIcon('Butter_robot.png'))
......
...@@ -9,9 +9,11 @@ Created on Tue May 21 20:08:33 2019 ...@@ -9,9 +9,11 @@ Created on Tue May 21 20:08:33 2019
import logging import logging
from logging.handlers import SocketHandler from logging.handlers import SocketHandler
log = logging.getLogger('Root logger') log = logging.getLogger('Main logger')
gui_log = log.getChild("GUI logger") gui_log = log.getChild("GUI logger")
worker_log = log.getChild("Worker logger") worker_log = log.getChild("Worker logger")
acq_log = log.getChild("Acquisition logger")
log.setLevel(1) # to send all records to cutelog log.setLevel(1) # to send all records to cutelog
socket_handler = SocketHandler('127.0.0.1', 19996) # default listening address socket_handler = SocketHandler('127.0.0.1', 19996) # default listening address
...@@ -19,3 +21,8 @@ log.addHandler(socket_handler) ...@@ -19,3 +21,8 @@ log.addHandler(socket_handler)
log.info('Hello world!') log.info('Hello world!')
gui_log.info('hello') gui_log.info('hello')
worker_log.info('hello') worker_log.info('hello')
acq_log.info('hello')
for i in range(5):
gui_log.debug('%i is the number'% (i) )
worker_log.info('{} sent to {}'.format(i, 'daq'))
\ No newline at end of file
...@@ -10,7 +10,25 @@ from MCDAQcontrolsignals import digital_control_signal ...@@ -10,7 +10,25 @@ from MCDAQcontrolsignals import digital_control_signal
from controlGui import ControlGui from controlGui import ControlGui
import logging
from logging.handlers import SocketHandler
if __name__ == "__main__": if __name__ == "__main__":
log = logging.getLogger('Main logger')
gui_log = log.getChild("GUI logger")
worker_log = log.getChild("Worker logger")
acq_log = log.getChild("Acquisition logger")
log.setLevel(1) # to send all records to cutelog
socket_handler = SocketHandler('127.0.0.1', 19996) # default listening address
log.addHandler(socket_handler)
log.info('Hello world!')
gui_log.info('hello')
worker_log.info('hello')
acq_log.info('hello')
import sys import sys
app = QtGui.QApplication([]) app = QtGui.QApplication([])
app_icon = QtGui.QIcon() app_icon = QtGui.QIcon()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment