From 41cbc64aba91e9b7a456e93c415f946b20d891f2 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Tue, 12 Oct 2021 16:23:48 +0200
Subject: [PATCH] Disable git logging to avoid an infinite loop

---
 devices/common/lofar_logging.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/devices/common/lofar_logging.py b/devices/common/lofar_logging.py
index e571ebb1f..4114d5dd3 100644
--- a/devices/common/lofar_logging.py
+++ b/devices/common/lofar_logging.py
@@ -114,6 +114,9 @@ def configure_logger(logger: logging.Logger=None, log_extra=None, debug=False):
     # remove spam from the OPC-UA client connection
     logging.getLogger("opcua").setLevel(logging.WARN)
 
+    # don't spam errors for git, as we use it in our log handler, which would result in an infinite loop
+    logging.getLogger("git").setLevel(logging.ERROR)
+
     # for now, also log to stderr
     # Set up logging in a way that it can be understood by a human reader, be
     # easily grep'ed, be parsed with a couple of shell commands and
-- 
GitLab