I am trying to rewrite this batch line in Python:
mkdir %TEMP%\FW >> %LOGDETAILS% 2>&1
When using subprocess.call(), how to set it in way that redirects stdout to a log file if you are using the dictionary configuration for logging?
My Python code looks like this so far (this is just part of it):
DICT_CONFIG = {#I have my settings in here}
logging.config.dictConfig(DICT_CONFIG)
logdetails = logging.getLogger('SikuliScriptDetails_Logger')
def my_function():
logdetails.info("---------Benginning Tests--------------")
#Set Project Name, Disable Feedback Dialogs by setting launches to 41
returncode = subprocess.call(["regedit", "-s", "MainFolder/FwSetup.reg"], stderr = STDOUT, stdout = logdetails)
I can not test my program for quite a while until I have some other modules ready. But is my attempt at redirection correct? Is this going to be able to log the output of the ["regedit", "-s", "MainFolder/FwSetup.reg"]
into my logdetails file logger?
Is it necessary for me to do stderr = STDOUT
first like I did before sending stdout to logdetails file logger?
Also, does anyone know what the 41 means? I do not know what to do with it.
PS: I've looked at this already, but I still don't get it since they are not using dictionary configuration for logging.
UPDATE: PS: I've also looked at this information to understand the batch line of code.
UPDATE2: Sorry, I gave you the wrong line of code at the beginning. The batch file I was supposed to give paste here is:
"regedit", "-s", "VBoxScripts/FwSetup.reg"
not this one: mkdir %TEMP%\FW >> %LOGDETAILS% 2>&1
Thanks.