From f07c9facfff5b836243666ece115ab2fd129abde Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Fri, 19 May 2023 18:32:31 -0500 Subject: [PATCH 1/2] Remove duplicate timestamp from test logs (`_trial_temp/test.log`) Fix https://github.com/matrix-org/synapse/issues/15618 --- tests/test_utils/logging_setup.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_utils/logging_setup.py b/tests/test_utils/logging_setup.py index b522163a3444..c37f205ed064 100644 --- a/tests/test_utils/logging_setup.py +++ b/tests/test_utils/logging_setup.py @@ -40,10 +40,9 @@ def setup_logging() -> None: """ root_logger = logging.getLogger() - log_format = ( - "%(asctime)s - %(name)s - %(lineno)d - " - "%(levelname)s - %(request)s - %(message)s" - ) + # We exclude `%(asctime)s` from this format because the Twisted logger adds its own + # timestamp + log_format = "%(name)s - %(lineno)d - " "%(levelname)s - %(request)s - %(message)s" handler = ToTwistedHandler() formatter = logging.Formatter(log_format) From a15dc47ae865fe0f026149d420930c46634c52e2 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Fri, 19 May 2023 18:35:27 -0500 Subject: [PATCH 2/2] Add changelog --- changelog.d/15636.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/15636.misc diff --git a/changelog.d/15636.misc b/changelog.d/15636.misc new file mode 100644 index 000000000000..82329c5e434b --- /dev/null +++ b/changelog.d/15636.misc @@ -0,0 +1 @@ +Remove duplicate timestamp from test logs (`_trial_temp/test.log`).