* [PATCH] insane.bbclass: write QA issues to log file only when thei are in ERROR_QA or WARN_QA
@ 2017-08-21 6:56 Martin Jansa
2017-08-21 7:01 ` Martin Jansa
2017-08-21 20:56 ` [PATCHv2] insane.bbclass: write QA issues to log file only when they " Martin Jansa
0 siblings, 2 replies; 7+ messages in thread
From: Martin Jansa @ 2017-08-21 6:56 UTC (permalink / raw)
To: openembedded-core
* QA check which aren't included in WARN_QA and ERROR_QA are shown
during the build only as NOTE message (not shown at all with default
knotty setting), so it might be surprising to see them later in qa.log
file
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/insane.bbclass | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index b7177c9b32..44e4a01c92 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -184,12 +184,13 @@ def package_qa_write_error(type, error, d):
f.write("%s: %s [%s]\n" % (p, error, type))
def package_qa_handle_error(error_class, error_msg, d):
- package_qa_write_error(error_class, error_msg, d)
if error_class in (d.getVar("ERROR_QA") or "").split():
+ package_qa_write_error(error_class, error_msg, d)
bb.error("QA Issue: %s [%s]" % (error_msg, error_class))
d.setVar("QA_SANE", False)
return False
elif error_class in (d.getVar("WARN_QA") or "").split():
+ package_qa_write_error(error_class, error_msg, d)
bb.warn("QA Issue: %s [%s]" % (error_msg, error_class))
else:
bb.note("QA Issue: %s [%s]" % (error_msg, error_class))
--
2.14.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] insane.bbclass: write QA issues to log file only when thei are in ERROR_QA or WARN_QA
2017-08-21 6:56 [PATCH] insane.bbclass: write QA issues to log file only when thei are in ERROR_QA or WARN_QA Martin Jansa
@ 2017-08-21 7:01 ` Martin Jansa
2017-08-21 20:56 ` [PATCHv2] insane.bbclass: write QA issues to log file only when they " Martin Jansa
1 sibling, 0 replies; 7+ messages in thread
From: Martin Jansa @ 2017-08-21 7:01 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 2294 bytes --]
Just notice typo in subject s/thei/they/g, will resend soon, in the
meantime is there some feedback on this?
Alternatively we can write them with NOTE: WARN: ERROR: prefix like with
the logger, so that the qa.log can be filtered by severity of the issue.
TL;DR; version:
In my jenkins builds I'm printing content of qa.log at the end of usually
very long build log, so that they are easier to spot in one place and
because I get a lot of "version-going-backwards" warnings which I'm not
interested in anymore at all, I've removed them from ERROR_QA - but then I
was wondering why I still see very long list of "version-going-backwards"
warnings, but those were from qa.log. It would work for me fine to just
"grep -v ^NOTE: qa.log" at the end of jenkins build if the alternative
solution is more acceptable.
On Mon, Aug 21, 2017 at 8:56 AM, Martin Jansa <martin.jansa@gmail.com>
wrote:
> * QA check which aren't included in WARN_QA and ERROR_QA are shown
> during the build only as NOTE message (not shown at all with default
> knotty setting), so it might be surprising to see them later in qa.log
> file
>
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
> meta/classes/insane.bbclass | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
> index b7177c9b32..44e4a01c92 100644
> --- a/meta/classes/insane.bbclass
> +++ b/meta/classes/insane.bbclass
> @@ -184,12 +184,13 @@ def package_qa_write_error(type, error, d):
> f.write("%s: %s [%s]\n" % (p, error, type))
>
> def package_qa_handle_error(error_class, error_msg, d):
> - package_qa_write_error(error_class, error_msg, d)
> if error_class in (d.getVar("ERROR_QA") or "").split():
> + package_qa_write_error(error_class, error_msg, d)
> bb.error("QA Issue: %s [%s]" % (error_msg, error_class))
> d.setVar("QA_SANE", False)
> return False
> elif error_class in (d.getVar("WARN_QA") or "").split():
> + package_qa_write_error(error_class, error_msg, d)
> bb.warn("QA Issue: %s [%s]" % (error_msg, error_class))
> else:
> bb.note("QA Issue: %s [%s]" % (error_msg, error_class))
> --
> 2.14.0
>
>
[-- Attachment #2: Type: text/html, Size: 3015 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCHv2] insane.bbclass: write QA issues to log file only when they are in ERROR_QA or WARN_QA
2017-08-21 6:56 [PATCH] insane.bbclass: write QA issues to log file only when thei are in ERROR_QA or WARN_QA Martin Jansa
2017-08-21 7:01 ` Martin Jansa
@ 2017-08-21 20:56 ` Martin Jansa
2017-08-21 21:07 ` Richard Purdie
1 sibling, 1 reply; 7+ messages in thread
From: Martin Jansa @ 2017-08-21 20:56 UTC (permalink / raw)
To: openembedded-core
* QA check which aren't included in WARN_QA and ERROR_QA are shown
during the build only as NOTE message (not shown at all with default
knotty setting), so it might be surprising to see them later in qa.log
file
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/classes/insane.bbclass | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index b7177c9b32..44e4a01c92 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -184,12 +184,13 @@ def package_qa_write_error(type, error, d):
f.write("%s: %s [%s]\n" % (p, error, type))
def package_qa_handle_error(error_class, error_msg, d):
- package_qa_write_error(error_class, error_msg, d)
if error_class in (d.getVar("ERROR_QA") or "").split():
+ package_qa_write_error(error_class, error_msg, d)
bb.error("QA Issue: %s [%s]" % (error_msg, error_class))
d.setVar("QA_SANE", False)
return False
elif error_class in (d.getVar("WARN_QA") or "").split():
+ package_qa_write_error(error_class, error_msg, d)
bb.warn("QA Issue: %s [%s]" % (error_msg, error_class))
else:
bb.note("QA Issue: %s [%s]" % (error_msg, error_class))
--
2.14.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCHv2] insane.bbclass: write QA issues to log file only when they are in ERROR_QA or WARN_QA
2017-08-21 20:56 ` [PATCHv2] insane.bbclass: write QA issues to log file only when they " Martin Jansa
@ 2017-08-21 21:07 ` Richard Purdie
2017-08-21 21:13 ` Martin Jansa
0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2017-08-21 21:07 UTC (permalink / raw)
To: Martin Jansa, openembedded-core
On Mon, 2017-08-21 at 22:56 +0200, Martin Jansa wrote:
> * QA check which aren't included in WARN_QA and ERROR_QA are shown
> during the build only as NOTE message (not shown at all with
> default
> knotty setting), so it might be surprising to see them later in
> qa.log
> file
>
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
> meta/classes/insane.bbclass | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
I've just been having a look at this and I think its by design, all
messages are put into the log but at differing log levels. I think the
correct thing to do may be to filter it as you proposed in your CI
system.
Any other opinions?
Cheers,
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCHv2] insane.bbclass: write QA issues to log file only when they are in ERROR_QA or WARN_QA
2017-08-21 21:07 ` Richard Purdie
@ 2017-08-21 21:13 ` Martin Jansa
2017-08-21 21:23 ` Richard Purdie
0 siblings, 1 reply; 7+ messages in thread
From: Martin Jansa @ 2017-08-21 21:13 UTC (permalink / raw)
To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 1444 bytes --]
> all messages are put into the log but at differing log levels.
But there aren't the "log levels" in the file (as NOTE, WARN, ERROR) now,
it writes only P, error message and type of QA check (not the selected
severity of it, like bb.error, bb.warn, bb.note used in the function for
normal output).
See the function above package_qa_handle_error:
def package_qa_write_error(type, error, d):
logfile = d.getVar('QA_LOGFILE')
if logfile:
p = d.getVar('P')
with open(logfile, "a+") as f:
f.write("%s: %s [%s]\n" % (p, error, type))
On Mon, Aug 21, 2017 at 11:07 PM, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:
> On Mon, 2017-08-21 at 22:56 +0200, Martin Jansa wrote:
> > * QA check which aren't included in WARN_QA and ERROR_QA are shown
> > during the build only as NOTE message (not shown at all with
> > default
> > knotty setting), so it might be surprising to see them later in
> > qa.log
> > file
> >
> > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > ---
> > meta/classes/insane.bbclass | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
>
> I've just been having a look at this and I think its by design, all
> messages are put into the log but at differing log levels. I think the
> correct thing to do may be to filter it as you proposed in your CI
> system.
>
> Any other opinions?
>
> Cheers,
>
> Richard
>
[-- Attachment #2: Type: text/html, Size: 2194 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCHv2] insane.bbclass: write QA issues to log file only when they are in ERROR_QA or WARN_QA
2017-08-21 21:13 ` Martin Jansa
@ 2017-08-21 21:23 ` Richard Purdie
2017-08-21 21:27 ` Martin Jansa
0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2017-08-21 21:23 UTC (permalink / raw)
To: Martin Jansa; +Cc: Patches and discussions about the oe-core layer
On Mon, 2017-08-21 at 23:13 +0200, Martin Jansa wrote:
> > all messages are put into the log but at differing log levels.
>
> But there aren't the "log levels" in the file (as NOTE, WARN, ERROR)
> now, it writes only P, error message and type of QA check (not the
> selected severity of it, like bb.error, bb.warn, bb.note used in the
> function for normal output).
>
> See the function above package_qa_handle_error:
>
> def package_qa_write_error(type, error, d):
> logfile = d.getVar('QA_LOGFILE')
> if logfile:
> p = d.getVar('P')
> with open(logfile, "a+") as f:
> f.write("%s: %s [%s]\n" % (p, error, type))
>
Sorry, I misread your earlier message and assumed it was logging the
level already. I've spent too long staring at bitbake server bugs :/.
I'm still torn on this, I can see why qa.log makes sense to contain all
the qa issues found and then the WARN/ERROR levels filter the console
output (and ultimately the bitbake exit code). I can also see why in
general we'd not want "levels" in the logfile, its more of a console
issue.
You could do "grep -v version-going-backwards qa.log" I guess?
Cheers,
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCHv2] insane.bbclass: write QA issues to log file only when they are in ERROR_QA or WARN_QA
2017-08-21 21:23 ` Richard Purdie
@ 2017-08-21 21:27 ` Martin Jansa
0 siblings, 0 replies; 7+ messages in thread
From: Martin Jansa @ 2017-08-21 21:27 UTC (permalink / raw)
To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 1899 bytes --]
> You could do "grep -v version-going-backwards qa.log" I guess?
In theory yes, in practice the same jenkins jobs are building different
DISTROs or different Yocto releases with different QA flags enabled, so I
would end up with using bitbke -e to find
WARN_QA and ERROR_QA for given build and then filter only those from qa.log.
I can still do it outside OE, I just didn't realize that there are reasons
for not wanting the levels in the log file (and I still don't know why it's
a good thing not to have them).
Regards,
On Mon, Aug 21, 2017 at 11:23 PM, Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:
> On Mon, 2017-08-21 at 23:13 +0200, Martin Jansa wrote:
> > > all messages are put into the log but at differing log levels.
> >
> > But there aren't the "log levels" in the file (as NOTE, WARN, ERROR)
> > now, it writes only P, error message and type of QA check (not the
> > selected severity of it, like bb.error, bb.warn, bb.note used in the
> > function for normal output).
> >
> > See the function above package_qa_handle_error:
> >
> > def package_qa_write_error(type, error, d):
> > logfile = d.getVar('QA_LOGFILE')
> > if logfile:
> > p = d.getVar('P')
> > with open(logfile, "a+") as f:
> > f.write("%s: %s [%s]\n" % (p, error, type))
> >
>
> Sorry, I misread your earlier message and assumed it was logging the
> level already. I've spent too long staring at bitbake server bugs :/.
>
> I'm still torn on this, I can see why qa.log makes sense to contain all
> the qa issues found and then the WARN/ERROR levels filter the console
> output (and ultimately the bitbake exit code). I can also see why in
> general we'd not want "levels" in the logfile, its more of a console
> issue.
>
> You could do "grep -v version-going-backwards qa.log" I guess?
>
> Cheers,
>
> Richard
>
>
>
[-- Attachment #2: Type: text/html, Size: 2852 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-08-21 21:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-21 6:56 [PATCH] insane.bbclass: write QA issues to log file only when thei are in ERROR_QA or WARN_QA Martin Jansa
2017-08-21 7:01 ` Martin Jansa
2017-08-21 20:56 ` [PATCHv2] insane.bbclass: write QA issues to log file only when they " Martin Jansa
2017-08-21 21:07 ` Richard Purdie
2017-08-21 21:13 ` Martin Jansa
2017-08-21 21:23 ` Richard Purdie
2017-08-21 21:27 ` Martin Jansa
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.