You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/pyOpenRPA/Orchestrator/Utils/LoggerHandlerDumpLogList.py

16 lines
666 B

from logging import StreamHandler
class LoggerHandlerDumpLogList(StreamHandler):
def __init__(self, inDict, inKeyStr, inHashKeyStr, inRowCountInt):
StreamHandler.__init__(self)
self.Dict = inDict
self.KeyStr = inKeyStr
self.HashKeyStr = inHashKeyStr
self.RowCountInt = inRowCountInt
self.Dict[self.HashKeyStr]="0"
def emit(self, inRecord):
inMessageStr = self.format(inRecord)
self.Dict[self.KeyStr].append(inMessageStr)
self.Dict[self.HashKeyStr]=str(int(self.Dict[self.HashKeyStr])+1)
if len(self.Dict[self.KeyStr])>self.RowCountInt:
self.Dict[self.KeyStr].pop(0)