Annotate logs around reporting
It's useful to annotate the logs around reporting with the event id that caused the action. Change-Id: I282c28fb0156070696f3d231a2a28f8f62deffca
This commit is contained in:
@@ -18,6 +18,7 @@ import logging
|
||||
import time
|
||||
import voluptuous as v
|
||||
|
||||
from zuul.lib.logutil import get_annotated_logger
|
||||
from zuul.reporter import BaseReporter
|
||||
from zuul.lib.artifacts import get_artifacts_from_result_data
|
||||
|
||||
@@ -30,9 +31,10 @@ class SQLReporter(BaseReporter):
|
||||
|
||||
def report(self, item):
|
||||
"""Create an entry into a database."""
|
||||
log = get_annotated_logger(self.log, item.event)
|
||||
|
||||
if not self.connection.tables_established:
|
||||
self.log.warn("SQL reporter (%s) is disabled " % self)
|
||||
log.warning("SQL reporter (%s) is disabled ", self)
|
||||
return
|
||||
|
||||
with self.connection.getSession() as db:
|
||||
|
||||
Reference in New Issue
Block a user