summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/oe-build-perf-test6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/oe-build-perf-test b/scripts/oe-build-perf-test
index 9f3ba44366..88af40ab76 100755
--- a/scripts/oe-build-perf-test
+++ b/scripts/oe-build-perf-test
@@ -34,7 +34,9 @@ from oeqa.utils.commands import runCmd
34 34
35 35
36# Set-up logging 36# Set-up logging
37logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s') 37LOG_FORMAT = '[%(asctime)s] %(levelname)s: %(message)s'
38logging.basicConfig(level=logging.INFO, format=LOG_FORMAT,
39 datefmt='%Y-%m-%d %H:%M:%S')
38log = logging.getLogger() 40log = logging.getLogger()
39 41
40 42
@@ -75,7 +77,7 @@ def setup_file_logging(log_file):
75 log_dir = os.path.dirname(log_file) 77 log_dir = os.path.dirname(log_file)
76 if not os.path.exists(log_dir): 78 if not os.path.exists(log_dir):
77 os.makedirs(log_dir) 79 os.makedirs(log_dir)
78 formatter = logging.Formatter('[%(asctime)s] %(levelname)s: %(message)s') 80 formatter = logging.Formatter(LOG_FORMAT)
79 handler = logging.FileHandler(log_file) 81 handler = logging.FileHandler(log_file)
80 handler.setFormatter(formatter) 82 handler.setFormatter(formatter)
81 log.addHandler(handler) 83 log.addHandler(handler)