[oe-commits] [openembedded-core] 06/07: rootfs.py: Reduce spam from _log_check_warn()
git at git.openembedded.org
git at git.openembedded.org
Thu May 19 08:16:19 UTC 2016
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit b46f8b61ee85eeb5a8ae37df0749a1426785cf1b
Author: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
AuthorDate: Thu May 19 00:28:17 2016 +0200
rootfs.py: Reduce spam from _log_check_warn()
For each warning found in the log, _log_check_warn() would output a
line stating that it had found a warning, then the actual warning and
finally an empty line. This is quite excessive when there are many
warnings in the log.
With this change the output is instead a line stating how many
warnings were found, followed by the warnings. This makes the output
much more compact and actually much more readable.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/lib/oe/rootfs.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 741399a..479e4cc 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -50,6 +50,7 @@ class Rootfs(object):
excludes = [re.compile(x) for x in excludes]
r = re.compile('^(warn|Warn|WARNING:)')
log_path = self.d.expand("${T}/log.do_rootfs")
+ messages = []
with open(log_path, 'r') as log:
for line in log:
for ee in excludes:
@@ -61,8 +62,14 @@ class Rootfs(object):
m = r.search(line)
if m:
- bb.warn('[log_check] %s: found a warning message in the logfile (keyword \'%s\'):\n[log_check] %s'
- % (self.d.getVar('PN', True), m.group(), line))
+ messages.append('[log_check] %s' % line)
+ if messages:
+ if len(messages) == 1:
+ msg = 'a warning message'
+ else:
+ msg = '%d warning messages' % len(messages)
+ bb.warn('[log_check] %s: found %s in the logfile:\n%s'
+ % (self.d.getVar('PN', True), msg, ''.join(messages)))
def _log_check_error(self):
# Ignore any lines containing log_check to avoid recursion, and ignore
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list