Commit 991dd05d authored by Arnaud Fontaine's avatar Arnaud Fontaine

Cosmetic

parent 5fd95ced
......@@ -121,7 +121,7 @@ class BenchmarkProcess(multiprocessing.Process):
self._nb_users,
self._user_index)
self._logger = result_instance.getLogger()
self._logger = result_instance.logger
# Ensure the data are flushed before exiting, handled by Result class
# __exit__ block
......
......@@ -100,7 +100,8 @@ class BenchmarkResult(object):
self.label_list = []
self._logger = None
def getLogger(self):
@property
def logger(self):
if not self._logger:
logging.basicConfig(stream=self.log_file, level=self._log_level)
self._logger = logging.getLogger('erp5.util.benchmark')
......@@ -131,7 +132,7 @@ class BenchmarkResult(object):
if self._first_iteration:
self.label_list = self.getLabelList()
self.getLogger().debug("RESULTS: %s" % self.result_list)
self.logger.debug("RESULTS: %s" % self.result_list)
self.result_list = []
self._first_iteration = False
self._suite_idx = 0
......@@ -219,7 +220,7 @@ class CSVBenchmarkResult(BenchmarkResult):
if exc_type and not issubclass(exc_type, StopIteration):
msg = "An error occured, see: %s" % self._log_filename_path
self.getLogger().error("%s: %s" % (exc_type, exc_value))
self.logger.error("%s: %s" % (exc_type, exc_value))
raise RuntimeError(msg)
from cStringIO import StringIO
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment