mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-10-26 07:46:11 +01:00
queuelogger: Use "import Queue as queue" for improved Python3 compatibility
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# Copyright (C) 2016-2019 Kevin O'Connor <kevin@koconnor.net>
|
||||
#
|
||||
# This file may be distributed under the terms of the GNU GPLv3 license.
|
||||
import logging, logging.handlers, threading, Queue, time
|
||||
import logging, logging.handlers, threading, Queue as queue, time
|
||||
|
||||
# Class to forward all messages through a queue to a background thread
|
||||
class QueueHandler(logging.Handler):
|
||||
@@ -25,7 +25,7 @@ class QueueListener(logging.handlers.TimedRotatingFileHandler):
|
||||
def __init__(self, filename):
|
||||
logging.handlers.TimedRotatingFileHandler.__init__(
|
||||
self, filename, when='midnight', backupCount=5)
|
||||
self.bg_queue = Queue.Queue()
|
||||
self.bg_queue = queue.Queue()
|
||||
self.bg_thread = threading.Thread(target=self._bg_thread)
|
||||
self.bg_thread.start()
|
||||
self.rollover_info = {}
|
||||
|
||||
Reference in New Issue
Block a user