[oe-commits] [openembedded-core] 04/21: oe-build-perf-test: align log message format with testrunner output

git at git.openembedded.org git at git.openembedded.org
Fri Aug 19 15:51:36 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 7a2d090a5916cd98ee6a1dc47689c6400c5872ba
Author: Markus Lehtonen <markus.lehtonen at linux.intel.com>
AuthorDate: Fri Aug 19 16:01:33 2016 +0300

    oe-build-perf-test: align log message format with testrunner output
    
    The previous attempt on this was a bit erroneous, dropping time stamps
    completely although only the timestamp format should've been changed.
    
    Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/oe-build-perf-test | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/oe-build-perf-test b/scripts/oe-build-perf-test
index 9f3ba44..88af40a 100755
--- a/scripts/oe-build-perf-test
+++ b/scripts/oe-build-perf-test
@@ -34,7 +34,9 @@ from oeqa.utils.commands import runCmd
 
 
 # Set-up logging
-logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
+LOG_FORMAT = '[%(asctime)s] %(levelname)s: %(message)s'
+logging.basicConfig(level=logging.INFO, format=LOG_FORMAT,
+                    datefmt='%Y-%m-%d %H:%M:%S')
 log = logging.getLogger()
 
 
@@ -75,7 +77,7 @@ def setup_file_logging(log_file):
     log_dir = os.path.dirname(log_file)
     if not os.path.exists(log_dir):
         os.makedirs(log_dir)
-    formatter = logging.Formatter('[%(asctime)s] %(levelname)s: %(message)s')
+    formatter = logging.Formatter(LOG_FORMAT)
     handler = logging.FileHandler(log_file)
     handler.setFormatter(formatter)
     log.addHandler(handler)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list