From ac84ba19f132dd76e05b35f22f8a608e43bf41c9 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Wed, 6 May 2020 22:30:36 +0000 Subject: [PATCH] error logging: Inline add_deployment_metadata. --- zerver/logging_handlers.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/zerver/logging_handlers.py b/zerver/logging_handlers.py index f1b4f556b5..512de2bbe3 100644 --- a/zerver/logging_handlers.py +++ b/zerver/logging_handlers.py @@ -25,12 +25,6 @@ def try_git_describe() -> Optional[str]: except Exception: # nocoverage return None -def add_deployment_metadata(report: Dict[str, Any]) -> None: - report['deployment_data'] = dict( - git=try_git_describe(), - ZULIP_VERSION=ZULIP_VERSION, - ) - def add_request_metadata(report: Dict[str, Any], request: HttpRequest) -> None: report['has_request'] = True @@ -103,7 +97,10 @@ class AdminNotifyHandler(logging.Handler): report['node'] = platform.node() report['host'] = platform.node() - add_deployment_metadata(report) + report['deployment_data'] = dict( + git=try_git_describe(), + ZULIP_VERSION=ZULIP_VERSION, + ) if record.exc_info: stack_trace = ''.join(traceback.format_exception(*record.exc_info))