fifolog.py

changeset 80
a409242121d5
parent 79
b075b3db3044
child 81
7bcd715f19e3
--- a/fifolog.py	Sun Jan 28 11:38:01 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#
-# FIFO memory logger
-#
-
-from logging.handlers import BufferingHandler
-
-class FIFOHandler(BufferingHandler):
-    def shouldFlush(self, record):
-        return False
-
-    def emit(self, record):
-        self.buffer.append(record)
-        l=len(self.buffer)
-        if l>self.capacity:
-            self.buffer=self.buffer[(l-self.capacity):(l-1)]
-
-    def formatAll(self):
-        return [self.format(record) for record in self.buffer]

mercurial