mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
16 lines
460 B
Python
16 lines
460 B
Python
|
from logging.handlers import BufferingHandler
|
||
|
|
||
|
|
||
|
class FTBufferingHandler(BufferingHandler):
|
||
|
def flush(self):
|
||
|
"""
|
||
|
Override Flush behaviour - we keep half of the configured capacity
|
||
|
otherwise, we have moments with "empty" logs.
|
||
|
"""
|
||
|
self.acquire()
|
||
|
try:
|
||
|
# Keep half of the records in buffer.
|
||
|
self.buffer = self.buffer[-int(self.capacity / 2):]
|
||
|
finally:
|
||
|
self.release()
|