diff --git a/Sources/pyOpenRPA/Orchestrator/BackwardCompatibility.py b/Sources/pyOpenRPA/Orchestrator/BackwardCompatibility.py index 327e109a..7d2d1348 100644 --- a/Sources/pyOpenRPA/Orchestrator/BackwardCompatibility.py +++ b/Sources/pyOpenRPA/Orchestrator/BackwardCompatibility.py @@ -327,7 +327,12 @@ def Update(inGSettings): # v1.1.20 to v1.2.0 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Update Structure gSettings["Processor"] + from . import SettingsTemplate if "Processor" in inGSettings: # Check if Processor exist + # Update Logger + if lL is not None: + SettingsTemplate.LoggerDumpLogHandlerAdd(inLogger=lL, inGSettingsClientDict=inGSettings["Client"]) + if lL: lL.warning(f"Backward compatibility (v1.1.20 to v1.2.0): Add web dump log in logger as handler") # Log about compatibility del inGSettings["Processor"] # Remove the key if lL: lL.warning(f"Backward compatibility (v1.1.20 to v1.2.0): Remove old structure 'Processor'") # Log about compatibility if "ProcessorDict" not in inGSettings: # Create new ProcessorDict structure diff --git a/Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py b/Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py index d0279eb4..bbc8d37e 100644 --- a/Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py +++ b/Sources/pyOpenRPA/Orchestrator/SettingsTemplate.py @@ -310,6 +310,22 @@ def __UACClientAdminCreate__(): } return lResultDict + +# Init the log dump to WEB +# import pdb; pdb.set_trace() +############################################ +def LoggerDumpLogHandlerAdd(inLogger, inGSettingsClientDict): + lL = inLogger + if len(lL.handlers) == 0: + mRobotLoggerFormatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') + else: + mRobotLoggerFormatter = lL.handlers[0].formatter + mHandlerDumpLogList = LoggerHandlerDumpLogList.LoggerHandlerDumpLogList(inDict=inGSettingsClientDict, + inKeyStr="DumpLogList", inHashKeyStr="DumpLogListHashStr", inRowCountInt=inGSettingsClientDict[ + "DumpLogListCountInt"]) + mHandlerDumpLogList.setFormatter(mRobotLoggerFormatter) + lL.addHandler(mHandlerDumpLogList) + # inModeStr: # "BASIC" - create standart configuration from pyOpenRPA.Orchestrator.Utils import LoggerHandlerDumpLogList @@ -337,6 +353,7 @@ def Create(inModeStr="BASIC"): handler.setFormatter(mRobotLoggerFormatter) mRobotLogger.addHandler(handler) ############################################ + LoggerDumpLogHandlerAdd(inLogger=mRobotLogger, inGSettingsClientDict=lResult["Client"]) #mHandlerDumpLogList = LoggerHandlerDumpLogList.LoggerHandlerDumpLogList(inDict=lResult["Client"], # inKeyStr="DumpLogList", # inHashKeyStr="DumpLogListHashStr", diff --git a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py index 00e793b0..3f701d57 100644 --- a/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py +++ b/Sources/pyOpenRPA/Orchestrator/__Orchestrator__.py @@ -855,20 +855,7 @@ def Orchestrator(inGSettings): inGSettings["VersionStr"] = __version__ #Logger alias lL = gSettingsDict["Logger"] - # Init the log dump to WEB - #import pdb; pdb.set_trace() - ############################################ - if len(lL.handlers)== 0: - mRobotLoggerFormatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') - else: - mRobotLoggerFormatter = lL.handlers[0].formatter - mHandlerDumpLogList = LoggerHandlerDumpLogList.LoggerHandlerDumpLogList(inDict=inGSettings["Client"], - inKeyStr="DumpLogList", - inHashKeyStr="DumpLogListHashStr", - inRowCountInt=inGSettings["Client"]["DumpLogListCountInt"]) - mHandlerDumpLogList.setFormatter(mRobotLoggerFormatter) - lL.addHandler(mHandlerDumpLogList) - + if lL: lL.info("Link the gSettings in submodules") #Logging Processor.gSettingsDict = gSettingsDict Timer.gSettingsDict = gSettingsDict