summary refs log tree commit diff
path: root/synapse/logging
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-10-01 08:09:18 -0400
committerGitHub <noreply@github.com>2020-10-01 08:09:18 -0400
commit4ff0201e6235b8b2efc5ce5a7dc3c479ea96df53 (patch)
tree632703075ef78aac894ac884f6fe722ec0b8784a /synapse/logging
parentAdd prometheus metrics to track federation delays (#8430) (diff)
downloadsynapse-4ff0201e6235b8b2efc5ce5a7dc3c479ea96df53.tar.xz
Enable mypy checking for unreachable code and fix instances. (#8432)
Diffstat (limited to 'synapse/logging')
-rw-r--r--synapse/logging/_structured.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/synapse/logging/_structured.py b/synapse/logging/_structured.py
index 144506c8f2..0fc2ea609e 100644
--- a/synapse/logging/_structured.py
+++ b/synapse/logging/_structured.py
@@ -12,7 +12,6 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
 import logging
 import os.path
 import sys
@@ -89,14 +88,7 @@ class LogContextObserver:
         context = current_context()
 
         # Copy the context information to the log event.
-        if context is not None:
-            context.copy_to_twisted_log_entry(event)
-        else:
-            # If there's no logging context, not even the root one, we might be
-            # starting up or it might be from non-Synapse code. Log it as if it
-            # came from the root logger.
-            event["request"] = None
-            event["scope"] = None
+        context.copy_to_twisted_log_entry(event)
 
         self.observer(event)