summaryrefslogtreecommitdiff
path: root/scripts/lib/scriptutils.py
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2017-03-20 14:51:01 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-21 22:43:04 +0000
commit60c9b06f4085f6bddb6aa397a38bfc2ceb10f964 (patch)
tree92c4396d667ca2c60e2dfc0834ac744d1dd813d6 /scripts/lib/scriptutils.py
parentc46faa132d39d3dc235a019d9abf6e46f74e3bae (diff)
downloadopenembedded-core-60c9b06f4085f6bddb6aa397a38bfc2ceb10f964.tar.gz
openembedded-core-60c9b06f4085f6bddb6aa397a38bfc2ceb10f964.tar.bz2
openembedded-core-60c9b06f4085f6bddb6aa397a38bfc2ceb10f964.zip
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@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts/lib/scriptutils.py')
-rw-r--r--scripts/lib/scriptutils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py
index 42337830eb..4ccbe5c108 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)