Configuring main autotest classes to use the new debug infrastructure,
converting 2 of the major verbosity sources on autotest and autoserv
executions. Logs with timestamps as a bonus :). The patch should apply
cleanly against svn trunk.
Visibility: Users and developers of the command line programs (autotest
and autoserv) will perceive a reduced verbosity, that can be increased
on the debug configuration file if needed.
Risk: Low (small number of changes, all tested and things were done
trying to isolate sources of failure as much as possible).
Signed-off-by: Lucas Meneghel Rodrigues <lucasmr@br.ibm.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@2261 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/common_lib/utils.py b/client/common_lib/utils.py
index 8132e9f..9437979 100644
--- a/client/common_lib/utils.py
+++ b/client/common_lib/utils.py
@@ -5,7 +5,7 @@
import os, pickle, random, re, resource, select, shutil, signal, StringIO
import socket, struct, subprocess, sys, time, textwrap, urllib, urlparse
import warnings
-from autotest_lib.client.common_lib import error, barrier
+from autotest_lib.client.common_lib import error, barrier, debug
def deprecated(func):
"""This is a decorator which can be used to mark functions as deprecated.
@@ -26,8 +26,9 @@
self.stdout_tee = stdout_tee
self.stderr_tee = stderr_tee
self.result = CmdResult(command)
+ self.log = debug.get_logger()
if verbose:
- print "running: %s" % command
+ self.log.debug("running: %s" % command)
self.sp = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
preexec_fn=self._reset_sigpipe, shell=True,