Fix Logging BUG with WEB dump

dev-linux
Ivan Maslov 4 years ago
parent 150300de34
commit f618515fc2

@ -382,7 +382,10 @@ def Update(inGSettings):
lItemDict = lRuleDomainUserDeepCopyDict[lItemKeyTurple] lItemDict = lRuleDomainUserDeepCopyDict[lItemKeyTurple]
if "ControlPanelKeyAllowedList" in lItemDict: if "ControlPanelKeyAllowedList" in lItemDict:
lShowWarnBool = True lShowWarnBool = True
if len(lItemDict["ControlPanelKeyAllowedList"])>0:
lUACClientDict = {"pyOpenRPADict": {"CPKeyDict": {}}} lUACClientDict = {"pyOpenRPADict": {"CPKeyDict": {}}}
else:
lUACClientDict = {}
for lAllowedKeyItemStr in lItemDict["ControlPanelKeyAllowedList"]: for lAllowedKeyItemStr in lItemDict["ControlPanelKeyAllowedList"]:
lUACClientDict["pyOpenRPADict"]["CPKeyDict"][lAllowedKeyItemStr]=True # Convert lUACClientDict["pyOpenRPADict"]["CPKeyDict"][lAllowedKeyItemStr]=True # Convert
# Send update UACDict for user by the list # Send update UACDict for user by the list

@ -337,11 +337,11 @@ def Create(inModeStr="BASIC"):
handler.setFormatter(mRobotLoggerFormatter) handler.setFormatter(mRobotLoggerFormatter)
mRobotLogger.addHandler(handler) mRobotLogger.addHandler(handler)
############################################ ############################################
mHandlerDumpLogList = LoggerHandlerDumpLogList.LoggerHandlerDumpLogList(inDict=lResult["Client"], #mHandlerDumpLogList = LoggerHandlerDumpLogList.LoggerHandlerDumpLogList(inDict=lResult["Client"],
inKeyStr="DumpLogList", # inKeyStr="DumpLogList",
inHashKeyStr="DumpLogListHashStr", # inHashKeyStr="DumpLogListHashStr",
inRowCountInt=lResult["Client"][ # inRowCountInt=lResult["Client"][
"DumpLogListCountInt"]) # "DumpLogListCountInt"])
mHandlerDumpLogList.setFormatter(mRobotLoggerFormatter) #mHandlerDumpLogList.setFormatter(mRobotLoggerFormatter)
mRobotLogger.addHandler(mHandlerDumpLogList) #mRobotLogger.addHandler(mHandlerDumpLogList)
return lResult # return the result dict return lResult # return the result dict

@ -1,9 +1,10 @@
import subprocess, json, psutil, time, os, win32security, sys, base64 #Get input argument import subprocess, json, psutil, time, os, win32security, sys, base64, logging #Get input argument
from . import Server from . import Server
from . import Timer from . import Timer
from . import Processor from . import Processor
from . import BackwardCompatibility # Backward compatibility from v1.1.13 from . import BackwardCompatibility # Backward compatibility from v1.1.13
from . import Core from . import Core
from .Utils import LoggerHandlerDumpLogList
# ATTENTION! HERE IS NO Relative import because it will be imported dynamically # ATTENTION! HERE IS NO Relative import because it will be imported dynamically
# All function check the flag SessionIsWindowResponsibleBool == True else no cammand is processed # All function check the flag SessionIsWindowResponsibleBool == True else no cammand is processed
@ -844,6 +845,20 @@ def Orchestrator(inGSettings):
# Turn on backward compatibility # Turn on backward compatibility
BackwardCompatibility.Update(inGSettings= gSettingsDict) BackwardCompatibility.Update(inGSettings= gSettingsDict)
# 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)
# Append Orchestrator def to ProcessorDictAlias # Append Orchestrator def to ProcessorDictAlias
lModule = sys.modules[__name__] lModule = sys.modules[__name__]
lModuleDefList = dir(lModule) lModuleDefList = dir(lModule)

Loading…
Cancel
Save