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]
if "ControlPanelKeyAllowedList" in lItemDict:
lShowWarnBool = True
lUACClientDict = {"pyOpenRPADict":{"CPKeyDict":{}}}
if len(lItemDict["ControlPanelKeyAllowedList"])>0:
lUACClientDict = {"pyOpenRPADict": {"CPKeyDict": {}}}
else:
lUACClientDict = {}
for lAllowedKeyItemStr in lItemDict["ControlPanelKeyAllowedList"]:
lUACClientDict["pyOpenRPADict"]["CPKeyDict"][lAllowedKeyItemStr]=True # Convert
# Send update UACDict for user by the list

@ -337,11 +337,11 @@ def Create(inModeStr="BASIC"):
handler.setFormatter(mRobotLoggerFormatter)
mRobotLogger.addHandler(handler)
############################################
mHandlerDumpLogList = LoggerHandlerDumpLogList.LoggerHandlerDumpLogList(inDict=lResult["Client"],
inKeyStr="DumpLogList",
inHashKeyStr="DumpLogListHashStr",
inRowCountInt=lResult["Client"][
"DumpLogListCountInt"])
mHandlerDumpLogList.setFormatter(mRobotLoggerFormatter)
mRobotLogger.addHandler(mHandlerDumpLogList)
#mHandlerDumpLogList = LoggerHandlerDumpLogList.LoggerHandlerDumpLogList(inDict=lResult["Client"],
# inKeyStr="DumpLogList",
# inHashKeyStr="DumpLogListHashStr",
# inRowCountInt=lResult["Client"][
# "DumpLogListCountInt"])
#mHandlerDumpLogList.setFormatter(mRobotLoggerFormatter)
#mRobotLogger.addHandler(mHandlerDumpLogList)
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 Timer
from . import Processor
from . import BackwardCompatibility # Backward compatibility from v1.1.13
from . import Core
from .Utils import LoggerHandlerDumpLogList
# ATTENTION! HERE IS NO Relative import because it will be imported dynamically
# All function check the flag SessionIsWindowResponsibleBool == True else no cammand is processed
@ -844,6 +845,20 @@ def Orchestrator(inGSettings):
# Turn on backward compatibility
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
lModule = sys.modules[__name__]
lModuleDefList = dir(lModule)

Loading…
Cancel
Save