Skip to content

Commit

Permalink
feat(send_kcidb.py): Remove log_excerpt from console logs
Browse files Browse the repository at this point in the history
log_excerpt is too large and fills up truncated docker and k8s
logs. Better to remove it from log output.

Signed-off-by: Denys Fedoryshchenko <[email protected]>
  • Loading branch information
nuclearcat committed Oct 9, 2024
1 parent 4fac03e commit 3964ae4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/send_kcidb.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,20 @@ def _remove_none_fields(self, data):
return [self._remove_none_fields(item) for item in data]
return data

def _print_debug(self, data):
"""Print debug information for the data being sent to KCIDB"""
fields = ['checkouts', 'builds', 'tests']
for field in fields:
if field in data:
for item in data[field]:
id = item.get('id')
self.log.debug(f"Sending to KCIDB: {field}: {id}")

def _send_revision(self, client, revision):
revision = self._remove_none_fields(revision)
if any(value for key, value in revision.items() if key != 'version'):
self.log.debug(f"DEBUG: sending revision: {revision}")
# remove log_excerpt field, as it is filling up the logs
self._print_debug(revision)
if kcidb.io.SCHEMA.is_valid(revision):
client.submit(revision)
else:
Expand Down

0 comments on commit 3964ae4

Please sign in to comment.