From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has uploaded a new change for review.
Change subject: logutils: drop QueueHandler ......................................................................
logutils: drop QueueHandler
The last usage of QueueHandler was removed by http://gerrit.ovirt.org/4318 . There is no need to keep this class around.
Change-Id: I725157f355c3c9be2b1a6521b83cde710a097653 Signed-off-by: Dan Kenigsberg danken@redhat.com --- M lib/vdsm/logUtils.py 1 file changed, 0 insertions(+), 52 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/77063/1
diff --git a/lib/vdsm/logUtils.py b/lib/vdsm/logUtils.py index 7a10976..e406876 100644 --- a/lib/vdsm/logUtils.py +++ b/lib/vdsm/logUtils.py @@ -97,58 +97,6 @@ return self.prefix + msg, kwargs
-class QueueHandler(logging.Handler): - """ - This handler sends events to a queue. Typically, it would be used together - with a multiprocessing Queue to centralise logging to file in one process - (in a multi-process application), so as to avoid file write contention - between processes. - - This code is new in Python 3.2, but this class can be copy pasted into - user code for use with earlier Python versions. - """ - - def __init__(self, queue): - """ - Initialise an instance, using the passed queue. - """ - logging.Handler.__init__(self) - self.queue = queue - - def enqueue(self, record): - """ - Enqueue a record. - - The base implementation uses put_nowait. You may want to override - this method if you want to use blocking, timeouts or custom queue - implementations. - """ - self.queue.put_nowait(record) - - def emit(self, record): - """ - Emit a record. - - Writes the LogRecord to the queue, preparing it for pickling first. - """ - try: - # The format operation gets traceback text into record.exc_text - # (if there's exception data), and also puts the message into - # record.message. We can then use this to replace the original - # msg + args, as these might be unpickleable. We also zap the - # exc_info attribute, as it's no longer needed and, if not None, - # will typically not be pickleable. - self.format(record) - record.msg = record.message - record.args = None - record.exc_info = None - self.enqueue(record) - except (KeyboardInterrupt, SystemExit): - raise - except: - self.handleError(record) - - class UserGroupEnforcingHandler(logging.handlers.WatchedFileHandler): """ This log handler acts like WatchedFileHandler.