summary refs log tree commit diff
path: root/synapse/logging/_structured.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2019-09-13 02:29:55 +1000
committerGitHub <noreply@github.com>2019-09-13 02:29:55 +1000
commitb617864cd9f81109e818bc5ae95bee317d917b72 (patch)
tree5bf6d0ee398731dc14ec73ac778ecaba98d0d3fb /synapse/logging/_structured.py
parentRemove the cap on federation retry interval. (#6026) (diff)
downloadsynapse-b617864cd9f81109e818bc5ae95bee317d917b72.tar.xz
Fix for structured logging tests stomping on logs (#6023)
Diffstat (limited to 'synapse/logging/_structured.py')
-rw-r--r--synapse/logging/_structured.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/logging/_structured.py b/synapse/logging/_structured.py
index 0367d6dfc4..3220e985a9 100644
--- a/synapse/logging/_structured.py
+++ b/synapse/logging/_structured.py
@@ -18,6 +18,7 @@ import os.path
 import sys
 import typing
 import warnings
+from typing import List
 
 import attr
 from constantly import NamedConstant, Names, ValueConstant, Values
@@ -33,7 +34,6 @@ from twisted.logger import (
     LogLevelFilterPredicate,
     LogPublisher,
     eventAsText,
-    globalLogBeginner,
     jsonFileLogObserver,
 )
 
@@ -134,7 +134,7 @@ class PythonStdlibToTwistedLogger(logging.Handler):
         )
 
 
-def SynapseFileLogObserver(outFile: typing.io.TextIO) -> FileLogObserver:
+def SynapseFileLogObserver(outFile: typing.IO[str]) -> FileLogObserver:
     """
     A log observer that formats events like the traditional log formatter and
     sends them to `outFile`.
@@ -265,7 +265,7 @@ def setup_structured_logging(
     hs,
     config,
     log_config: dict,
-    logBeginner: LogBeginner = globalLogBeginner,
+    logBeginner: LogBeginner,
     redirect_stdlib_logging: bool = True,
 ) -> LogPublisher:
     """
@@ -286,7 +286,7 @@ def setup_structured_logging(
     if "drains" not in log_config:
         raise ConfigError("The logging configuration requires a list of drains.")
 
-    observers = []
+    observers = []  # type: List[ILogObserver]
 
     for observer in parse_drain_configs(log_config["drains"]):
         # Pipe drains