Skip to content

Commit

Permalink
Make GitPython messages show up in dashboard logs (#2584)
Browse files Browse the repository at this point in the history
Make GitPython messages show up in dashboard logs

Related to packit/packit#2448.

Reviewed-by: Laura Barcziová
  • Loading branch information
softwarefactory-project-zuul[bot] authored Oct 16, 2024
2 parents 5622b78 + e7bfab5 commit 043a64e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packit_service/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ def gather_packit_logs_to_buffer(
packit_logger = logging.getLogger("packit")
packit_logger.setLevel(logging_level)
packit_logger.addHandler(handler)
git_logger = logging.getLogger("git")
git_logger.setLevel(logging_level)
git_logger.addHandler(handler)
handler.setFormatter(PackitFormatter())
return buffer, handler

Expand All @@ -143,6 +146,8 @@ def collect_packit_logs(buffer: StringIO, handler: StreamHandler) -> str:
"""
packit_logger = logging.getLogger("packit")
packit_logger.removeHandler(handler)
git_logger = logging.getLogger("git")
git_logger.removeHandler(handler)
buffer.seek(0)
return buffer.read()

Expand Down

0 comments on commit 043a64e

Please sign in to comment.