diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2016-06-29 15:08:34 -0500 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2018-05-04 23:57:52 +1200 |
commit | 6b8cfecf481956d4dbdbd0436d42a48729179029 (patch) | |
tree | 53a6886343e5a7df3b3b662a3271b0a9ea9550d5 /rrs/tools/common.py | |
parent | 48375d481cd5ae67b543dc6d7884858c3acfc55e (diff) | |
download | openembedded-core-contrib-6b8cfecf481956d4dbdbd0436d42a48729179029.tar.gz |
layerindex,rrs: Minor changes to work with python3.
[YOCTO #9746]
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Diffstat (limited to 'rrs/tools/common.py')
-rw-r--r-- | rrs/tools/common.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rrs/tools/common.py b/rrs/tools/common.py index 32fce45e70..69a0d0103b 100644 --- a/rrs/tools/common.py +++ b/rrs/tools/common.py @@ -5,13 +5,15 @@ # # Licensed under the MIT license, see COPYING.MIT for details +import logging + def common_setup(): import sys, os sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '../../'))) def get_logger(name, settings): - import logging import os + from logging.handlers import RotatingFileHandler logger = logging.getLogger(name) formatter = logging.Formatter("%(asctime)s: %(levelname)s: %(message)s") @@ -22,8 +24,8 @@ def get_logger(name, settings): filename = os.path.join(settings.TOOLS_LOG_DIR, name) maxBytes = 8388608 # 8MB - handler = logging.handlers.RotatingFileHandler(filename, - maxBytes=maxBytes) + handler = RotatingFileHandler(filename, maxBytes=maxBytes) + handler.setFormatter(formatter) logger.addHandler(handler) |