|
14 | 14 | set_code_variables_mask_patterns_context as inner_set_code_variables_mask_patterns_context, |
15 | 15 | set_code_variables_ignore_patterns_context as inner_set_code_variables_ignore_patterns_context, |
16 | 16 | ) |
| 17 | +from posthog.exception_utils import ( |
| 18 | + DEFAULT_CODE_VARIABLES_IGNORE_PATTERNS, |
| 19 | + DEFAULT_CODE_VARIABLES_MASK_PATTERNS, |
| 20 | +) |
17 | 21 | from posthog.feature_flags import InconclusiveMatchError, RequiresServerEvaluation |
18 | 22 | from posthog.types import FeatureFlag, FlagsAndPayloads, FeatureFlagResult |
19 | 23 | from posthog.version import VERSION |
@@ -177,6 +181,10 @@ def tag(name: str, value: Any): |
177 | 181 |
|
178 | 182 | default_client = None # type: Optional[Client] |
179 | 183 |
|
| 184 | +capture_exception_code_variables = False |
| 185 | +code_variables_mask_patterns = DEFAULT_CODE_VARIABLES_MASK_PATTERNS |
| 186 | +code_variables_ignore_patterns = DEFAULT_CODE_VARIABLES_IGNORE_PATTERNS |
| 187 | + |
180 | 188 |
|
181 | 189 | # NOTE - this and following functions take unpacked kwargs because we needed to make |
182 | 190 | # it impossible to write `posthog.capture(distinct-id, event-name)` - basically, to enforce |
@@ -771,6 +779,9 @@ def setup() -> Client: |
771 | 779 | enable_exception_autocapture=enable_exception_autocapture, |
772 | 780 | log_captured_exceptions=log_captured_exceptions, |
773 | 781 | enable_local_evaluation=enable_local_evaluation, |
| 782 | + capture_exception_code_variables=capture_exception_code_variables, |
| 783 | + code_variables_mask_patterns=code_variables_mask_patterns, |
| 784 | + code_variables_ignore_patterns=code_variables_ignore_patterns, |
774 | 785 | ) |
775 | 786 |
|
776 | 787 | # always set incase user changes it |
|
0 commit comments