1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

bitbake: toaster: Record critical errors

Critical errors (where a build failed for reasons of
misconfiguration, such as a machine being specified which is not
in a project's layers) were being ignored (only log records
up to ERROR level were being logged to Toaster's db). This meant that
the build would fail but would not correctly report why.

Add support for CRITICAL error levels to the LogMessage model,
include errors at this level in the errors property for a build,
and show errors at this level in the build dashboard.

[YOCTO #8320]

(Bitbake rev: b6eacbca9cacb607de864ab7d093deb296da8226)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Elliot Smith
2015-10-15 15:45:13 +03:00
committed by Richard Purdie
parent 069a611097
commit 93f0b61749
4 changed files with 24 additions and 12 deletions
+12 -6
View File
@@ -353,7 +353,9 @@ class Build(models.Model):
@property
def errors(self):
return (self.logmessage_set.filter(level=LogMessage.ERROR)|self.logmessage_set.filter(level=LogMessage.EXCEPTION))
return (self.logmessage_set.filter(level=LogMessage.ERROR) |
self.logmessage_set.filter(level=LogMessage.EXCEPTION) |
self.logmessage_set.filter(level=LogMessage.CRITICAL))
@property
def warnings(self):
@@ -1285,16 +1287,20 @@ class LogMessage(models.Model):
INFO = 0
WARNING = 1
ERROR = 2
CRITICAL = 3
LOG_LEVEL = ( (INFO, "info"),
(WARNING, "warn"),
(ERROR, "error"),
(EXCEPTION, "toaster exception"))
LOG_LEVEL = (
(INFO, "info"),
(WARNING, "warn"),
(ERROR, "error"),
(CRITICAL, "critical"),
(EXCEPTION, "toaster exception")
)
build = models.ForeignKey(Build)
task = models.ForeignKey(Task, blank = True, null=True)
level = models.IntegerField(choices=LOG_LEVEL, default=INFO)
message=models.CharField(max_length=240)
message = models.CharField(max_length=240)
pathname = models.FilePathField(max_length=255, blank=True)
lineno = models.IntegerField(null=True)