I have this code:
I have a logger defined, and all the logs goes to the file. Now, what I want to do is, log output and error of subprocess to this log_file. Also I can you tell what does it do, when you set stderr=subproce ss.PIPE and stdout=subproce ss.PIPE, and where does the log get output and errors get written?
Code:
cmd_output =subprocess.Popen([cmd], shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate()
log.debug(cmd))
Comment