1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-01 10:52:33 +01:00

daqpower: updating to work with new versions of twisted.

This commit is contained in:
Sergei Trofimov
2015-07-20 17:40:02 +01:00
parent 89da25c25e
commit 39ed42ccb9
4 changed files with 6 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -14,4 +14,4 @@
# #
__version__ = '1.0.4' __version__ = '1.0.5'

View File

@@ -29,6 +29,11 @@ critical = lambda x: log.msg(x, logLevel=logging.CRITICAL)
class CustomLoggingObserver(log.PythonLoggingObserver): class CustomLoggingObserver(log.PythonLoggingObserver):
def __init__(self, loggerName="twisted"):
super(CustomLoggingObserver, self).__init__(loggerName)
if not hasattr(self, '_newObserver'): # new vesions of Twisted
self.logger = self._newObserver.logger # pylint: disable=no-member
def emit(self, eventDict): def emit(self, eventDict):
if 'logLevel' in eventDict: if 'logLevel' in eventDict:
level = eventDict['logLevel'] level = eventDict['logLevel']