Skip to content
Browse files

added label parameter to log creation for debugging

  • Loading branch information...
1 parent 2c7a9f8 commit 11775e052fab65ec96f750c2b48d14dfbc4b94de @trey0 trey0 committed Dec 1, 2012
Showing with 9 additions and 4 deletions.
  1. +5 −2 geocamPycroraptor2/log.py
  2. +4 −2 geocamPycroraptor2/service.py
View
7 geocamPycroraptor2/log.py
@@ -164,10 +164,13 @@ def flush(self):
class StreamLogger(object):
- def __init__(self, inFd, logger, level=logging.DEBUG, maxLineLength=160):
+ def __init__(self, inFd, logger,
+ level=logging.DEBUG,
+ maxLineLength=160,
+ label=None):
self._logger = logger
self._logger.setLevel(level)
- self._q = queueFromFile(inFd, maxLineLength)
+ self._q = queueFromFile(inFd, maxLineLength, label)
self._job = gevent.spawn(self._handleQueue)
def _handleQueue(self):
View
6 geocamPycroraptor2/service.py
@@ -144,11 +144,13 @@ def start(self):
self._outLogger = (log.StreamLogger
(childStdoutReadFd,
- self._logger.getChild('out')))
+ self._logger.getChild('out'),
+ label='%s.out' % self._name))
self._errLogger = (log.StreamLogger
(childStderrReadFd,
- self._logger.getChild('err')))
+ self._logger.getChild('err'),
+ label='%s.err' % self._name))
self._childStdin = self._proc.stdin
self._setStatus(dict(status=statuslib.RUNNING,
procStatus=statuslib.RUNNING,

0 comments on commit 11775e0

Please sign in to comment.
Something went wrong with that request. Please try again.