]> code.ossystems Code Review - openembedded-core.git/commit
targetcontrol.py: use logger.info to replace of bb.note
authorRobert Yang <liezhi.yang@windriver.com>
Fri, 24 Mar 2017 08:45:02 +0000 (01:45 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 26 Mar 2017 12:17:02 +0000 (13:17 +0100)
commitb139790422bc8e0d80bad063bb78bc1632731bc1
tree617a76e2d39bba85cc1d57021a40e69979d57885
parente7073cb4786411bb71645e7d7cbc1c510910c4cc
targetcontrol.py: use logger.info to replace of bb.note

The bb.note prints multiple same lines when invoke this class again, but
if we set mainlogger.propagate = False, nothing would be printed,
according to logging's document:

https://docs.python.org/3/library/logging.html
Note
If you attach a handler to a logger and one or more of its ancestors, it
may emit the same record multiple times. In general, you should not need
to attach a handler to more than one logger - if you just attach it to
the appropriate logger which is highest in the logger hierarchy, then it
will see all events logged by all descendant loggers, provided that
their propagate setting is left set to True. A common scenario is to
attach handlers only to the root logger, and to let propagation take
care of the rest.

We may need avoid using bb.note or bb.warn in oeqa since it attaches
multiple log handlers which may cause confusions

This patch only sets "mainlogger.propagate = False" in
selftest/runqemu.py and use logger.info to replace bb.note in
targetcontrol.py to minimize the impact.

[YOCTO #10249]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/runqemu.py
meta/lib/oeqa/targetcontrol.py