]> rtime.felk.cvut.cz Git - linux-conf-perf.git/commitdiff
Write stderr to log file together with stdout
authorKarel Kočí <cynerd@email.cz>
Tue, 18 Aug 2015 13:48:11 +0000 (15:48 +0200)
committerKarel Kočí <cynerd@email.cz>
Tue, 18 Aug 2015 13:48:11 +0000 (15:48 +0200)
Utils function callsubprocess now logs all program output including
stderr.
Convenient would be to print stderr even if output is disabled. But
this would probably required threads.

scripts/utils.py

index 7a7a79d1e27102a2d1315dec4d97a747625950f1..742aec56029d0447bbac2a850e61dd8e6f665670 100644 (file)
@@ -31,7 +31,8 @@ def build_symbol_map():
 def callsubprocess(process_name, process, show_output = True,
                return_output = False, env=os.environ, allowed_exit_codes = [0],
                allow_all_exit_codes = False):
-       sprc = subprocess.Popen(process, stdout = subprocess.PIPE, env = env)
+       sprc = subprocess.Popen(process, stdout = subprocess.PIPE,
+                       stderr = subprocess.STDOUT, env = env)
 
        try:
                os.mkdir(os.path.join(sf(conf.log_folder), process_name))