Make autoserv and autotest client use the new logging_manager system.  I'd like to split them into separate changes, but the change in common_lib.test means it all has to change at once.

this replaces the old ini-style logging configurations with code-based configurations.  i know the ini files were easier to read, but we're doing a lot more fancy stuff with logging and these give us much more power and less duplication.  as one example, we'll probably move very soon to having separate .DEBUG, .INFO, .WARNING, and .ERROR logs.  This will allow us to make a centralized change to make that happen, rather than duplicating a whole bunch of information across .ini files, and it'll make the information much more concise.

Risk: Gravely high

Signed-off-by: Steve Howard <showard@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@3243 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/bin/kernel.py b/client/bin/kernel.py
index 6554ea6..dd6513b 100755
--- a/client/bin/kernel.py
+++ b/client/bin/kernel.py
@@ -1,10 +1,33 @@
 import os, shutil, copy, pickle, re, glob, time
-from autotest_lib.client.bin.fd_stack import tee_output_logdir_mark
 from autotest_lib.client.bin import kernel_config, os_dep, kernelexpand, test
 from autotest_lib.client.bin import utils
 from autotest_lib.client.common_lib import log, error, packages
 
 
+def _mark(filename, msg):
+    file = open(filename, 'a')
+    file.write(msg)
+    file.close()
+
+
+def tee_output_logdir_mark(fn):
+    def tee_logdir_mark_wrapper(self, *args, **dargs):
+        mark = self.__class__.__name__ + "." + fn.__name__
+        outfile = os.path.join(self.log_dir, 'client.log')
+        _mark(outfile, "--- START " + mark + " ---\n")
+        self.job.logging.tee_redirect_debug_dir(self.log_dir)
+        try:
+            result = fn(self, *args, **dargs)
+        finally:
+            self.job.logging.restore()
+            _mark(outfile, "--- END " + mark + " ---\n")
+
+        return result
+
+    tee_logdir_mark_wrapper.__name__ = fn.__name__
+    return tee_logdir_mark_wrapper
+
+
 class kernel(object):
     """ Class for compiling kernels.