def updateState(self):

        t = SimpleTimer()
        self.manager.updateExistingLoggerProcesses()

        activeLogFiles = self.manager.getActiveLogFilenames()
        self.numProcesses = len(self.manager.getActiveLoggerPids())
        self.numLogFiles = len(activeLogFiles)

        if self.numLogFiles == 1:
            self.lastActiveLogFile = activeLogFiles[0]

        if self.numProcesses == 0:
            self.button.text = 'start logger'
        elif self.numProcesses == 1:
            self.button.text = 'stop logger'
        elif self.numProcesses > 1:
            self.button.text = 'stop all loggers'

        statusDescription = 'active' if self.numProcesses else 'last'
        logFileDescription = self.lastActiveLogFile or '<unknown>'
        self.button.setToolTip('%s log file: %s' % (statusDescription, logFileDescription))
dataset/ETHPy150Open RobotLocomotion/director/src/python/director/lcmloggerwidget.py/LCMLoggerWidget.updateState/original