[oe-commits] [openembedded-core] 48/65: scriptutils: Add support for specify stream on logger_create

git at git.openembedded.org git at git.openembedded.org
Wed Mar 22 10:14:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

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

commit 60c9b06f4085f6bddb6aa397a38bfc2ceb10f964
Author: Aníbal Limón <anibal.limon at linux.intel.com>
AuthorDate: Mon Mar 20 14:51:01 2017 -0600

    scriptutils: Add support for specify stream on logger_create
    
    It is a good idea to let the script to choose what stream wants
    to dump the logging output.
    
    [YOCTO #11160]
    
    Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 scripts/lib/scriptutils.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py
index 4233783..4ccbe5c 100644
--- a/scripts/lib/scriptutils.py
+++ b/scripts/lib/scriptutils.py
@@ -22,9 +22,9 @@ import glob
 import argparse
 import subprocess
 
-def logger_create(name):
+def logger_create(name, stream=None):
     logger = logging.getLogger(name)
-    loggerhandler = logging.StreamHandler()
+    loggerhandler = logging.StreamHandler(stream=stream)
     loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
     logger.addHandler(loggerhandler)
     logger.setLevel(logging.INFO)

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


More information about the Openembedded-commits mailing list