Revert "FAFT: Reorganize the logging code"

This reverts commit 6db59cbabdc0e9b0ad823af319b4e40718a26c0f.

Change-Id: I5b4047f0c546a45f7e55ddfeae8dcb93496f5410
Reviewed-on: https://chromium-review.googlesource.com/291803
Commit-Ready: Wai-Hong Tam <waihong@chromium.org>
Tested-by: danny chan <dchan@chromium.org>
Reviewed-by: Wai-Hong Tam <waihong@chromium.org>
diff --git a/client/cros/faft/rpc_functions.py b/client/cros/faft/rpc_functions.py
index 2f6a545..05408c9 100755
--- a/client/cros/faft/rpc_functions.py
+++ b/client/cros/faft/rpc_functions.py
@@ -7,7 +7,7 @@
 These can be exposed via a xmlrpci server running on the DUT.
 """
 
-import functools, logging, os, shutil, tempfile
+import functools, os, shutil, tempfile
 
 import common
 from autotest_lib.client.cros.faft.utils import (cgpt_state,
@@ -95,16 +95,12 @@
         # TODO(waihong): Move the explicit object.init() methods to the
         # objects' constructors (ChromeOSInterface, FlashromHandler,
         # KernelHandler, and TpmHandler).
-        self._chromeos_interface = chromeos_interface.ChromeOSInterface()
+        self._chromeos_interface = chromeos_interface.ChromeOSInterface(False)
         # We keep the state of FAFT test in a permanent directory over reboots.
         state_dir = '/var/tmp/faft'
-        self._chromeos_interface.init(state_dir)
-        os.chdir(state_dir)
-
         self._log_file = os.path.join(state_dir, 'faft_client.log')
-        logging.basicConfig(level=logging.DEBUG,
-                            format='%(asctime)s %(levelname)s %(message)s',
-                            filename=self._log_file)
+        self._chromeos_interface.init(state_dir, log_file=self._log_file)
+        os.chdir(state_dir)
 
         self._bios_handler = LazyFlashromHandlerProxy(
                                 saft_flashrom_util,
@@ -181,8 +177,8 @@
         if is_str:
             return str(func)
         else:
-            logging.debug('Dispatching method %s with args %s',
-                          func.__name__, str(params))
+            self._chromeos_interface.log('Dispatching method %s with args %s' %
+                    (str(func), str(params)))
             return func(*params)
 
     def _system_is_available(self):
@@ -394,8 +390,9 @@
         original_version = self._bios_get_version(section)
         new_version = original_version + delta
         flags = self._bios_handler.get_section_flags(section)
-        logging.info('Setting firmware section %s version from %d to %d',
-                     section, original_version, new_version)
+        self._chromeos_interface.log(
+                'Setting firmware section %s version from %d to %d' % (
+                section, original_version, new_version))
         self._bios_handler.set_section_version(section, new_version, flags,
                                                write_through=True)
 
@@ -601,8 +598,9 @@
         """
         original_version = self._kernel_handler.get_version(section)
         new_version = original_version + delta
-        logging.info('Setting kernel section %s version from %d to %d',
-                     section, original_version, new_version)
+        self._chromeos_interface.log(
+                'Setting kernel section %s version from %d to %d' % (
+                section, original_version, new_version))
         self._kernel_handler.set_version(section, new_version)
 
     @allow_multiple_section_input