|
10 | 10 | from typing import TYPE_CHECKING, List, Dict, cast, overload |
11 | 11 | import warnings |
12 | 12 |
|
13 | | -from sentry_sdk import get_current_scope |
14 | 13 | from sentry_sdk._compat import PY37, check_uwsgi_thread_support |
15 | 14 | from sentry_sdk.utils import ( |
16 | 15 | AnnotatedValue, |
@@ -209,8 +208,8 @@ def capture_event(self, *args, **kwargs): |
209 | 208 | # type: (*Any, **Any) -> Optional[str] |
210 | 209 | return None |
211 | 210 |
|
212 | | - def capture_log(self, severity_text, severity_number, template, **kwargs): |
213 | | - # type: (str, int, str, **Any) -> None |
| 211 | + def capture_log(self, scope, severity_text, severity_number, template, **kwargs): |
| 212 | + # type: (Scope, str, int, str, **Any) -> None |
214 | 213 | pass |
215 | 214 |
|
216 | 215 | def capture_session(self, *args, **kwargs): |
@@ -854,8 +853,8 @@ def capture_event( |
854 | 853 |
|
855 | 854 | return return_value |
856 | 855 |
|
857 | | - def capture_log(self, severity_text, severity_number, template, **kwargs): |
858 | | - # type: (str, int, str, **Any) -> None |
| 856 | + def capture_log(self, scope, severity_text, severity_number, template, **kwargs): |
| 857 | + # type: (Scope, str, int, str, **Any) -> None |
859 | 858 | if not self.options.get("enable_sentry_logs", False): |
860 | 859 | return |
861 | 860 |
|
@@ -894,7 +893,7 @@ def format_attribute(key: str, val: int | float | str | bool): |
894 | 893 | "time_unix_nano": time.time_ns(), |
895 | 894 | } |
896 | 895 |
|
897 | | - if (ctx := get_current_scope().get_active_propagation_context()) is not None: |
| 896 | + if (ctx := scope.get_active_propagation_context()) is not None: |
898 | 897 | headers["trace_id"] = ctx.trace_id |
899 | 898 | log["trace_id"] = ctx.trace_id |
900 | 899 | envelope = Envelope(headers=headers) |
|
0 commit comments