diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2017-03-20 14:51:01 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-22 11:35:21 +0000 |
commit | 15e65f5f07fd720487a7a09c2854dae1192cc4ac (patch) | |
tree | 4eecb2d22b269ca442a8a5670230d88d4f49813e /scripts/lib/scriptutils.py | |
parent | c8e8e50bc3a517740087902f5fdbf30cc2c73818 (diff) | |
download | poky-15e65f5f07fd720487a7a09c2854dae1192cc4ac.tar.gz |
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]
(From OE-Core rev: 60c9b06f4085f6bddb6aa397a38bfc2ceb10f964)
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/scriptutils.py')
-rw-r--r-- | scripts/lib/scriptutils.py | 4 |
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 | |||
22 | import argparse | 22 | import argparse |
23 | import subprocess | 23 | import subprocess |
24 | 24 | ||
25 | def logger_create(name): | 25 | def logger_create(name, stream=None): |
26 | logger = logging.getLogger(name) | 26 | logger = logging.getLogger(name) |
27 | loggerhandler = logging.StreamHandler() | 27 | loggerhandler = logging.StreamHandler(stream=stream) |
28 | loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s")) | 28 | loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s")) |
29 | logger.addHandler(loggerhandler) | 29 | logger.addHandler(loggerhandler) |
30 | logger.setLevel(logging.INFO) | 30 | logger.setLevel(logging.INFO) |