Commit c3e944af authored by Arnaud Fontaine's avatar Arnaud Fontaine

Display timestamp in each log entry for erp5.util.testbrowser and erp5.util.benchmark

parent 4a128d7e
......@@ -152,7 +152,6 @@ class BenchmarkProcess(multiprocessing.Process):
_socket = socket.socket
def _patched_socket(*args, **kwargs):
new_socket = _socket(*args, **kwargs)
self._logger.debug("source IP: %s" % self._source_ip)
new_socket.bind((self._source_ip, 0))
return new_socket
......@@ -173,8 +172,7 @@ class BenchmarkProcess(multiprocessing.Process):
self._browser = self.getBrowser(result_instance.log_file)
while self._current_repeat != (self._argument_namespace.repeat + 1):
self._logger.info("%s: Iteration: %d" % (datetime.datetime.now(),
self._current_repeat))
self._logger.info("Iteration: %d" % self._current_repeat)
self.runBenchmarkSuiteList(result)
if not self._current_repeat % RESULT_NUMBER_BEFORE_FLUSHING:
......
......@@ -100,9 +100,11 @@ class BenchmarkResult(object):
@property
def logger(self):
if not self._logger:
logging.basicConfig(stream=self.log_file,
level=(self._argument_namespace.enable_debug and
logging.DEBUG or logging.INFO))
logging.basicConfig(
stream=self.log_file,
level=(self._argument_namespace.enable_debug and
logging.DEBUG or logging.INFO),
format='%(asctime)s: %(levelname)s: %(message)s [%(name)s]')
self._logger = logging.getLogger('erp5.util.benchmark')
return self._logger
......
......@@ -172,7 +172,9 @@ class Browser(ExtendedTestBrowser):
# Only display WARNING message if debugging is not enabled
logging_level = is_debug and logging.DEBUG or logging.WARNING
stream = log_file and log_file or sys.stderr
logging.basicConfig(stream=stream, level=logging_level)
logging.basicConfig(
stream=stream, level=logging_level,
format='%(asctime)s: %(levelname)s: %(message)s [%(name)s]')
self._logger = logging.getLogger('erp5.util.testbrowser')
self._is_legacy_listbox = is_legacy_listbox
......
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