Skip to content

Commit

Permalink
disable error logging (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenny-statsig authored Jan 29, 2024
1 parent 9057087 commit bbd16fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions statsig/statsig_error_boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def log_exception(self, tag: str, exception: Exception, extra: dict = None):
if self._is_silent is False:
globals.logger.warning("[Statsig]: An unexpected error occurred.")
globals.logger.warning(traceback.format_exc())
if hasattr(self._options, 'disable_all_logging') and self._options.disable_all_logging:
return

name = type(exception).__name__
if self._api_key is None or name in self._seen:
Expand Down
2 changes: 1 addition & 1 deletion statsig/statsig_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, net, shutdown_event, statsig_metadata, error_boundary, option
self._net = net
self._statsig_metadata = statsig_metadata
self._local_mode = options.local_mode
self._disabled = options.disable_event_logging
self._disabled = options.disable_all_logging
self._console_logger = globals.logger
self._logging_interval = options.logging_interval
self._retry_interval = options.logging_interval
Expand Down
4 changes: 2 additions & 2 deletions statsig/statsig_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(
disable_diagnostics: bool = False,
custom_logger: Optional[OutputLogger] = None,
enable_debug_logs = False,
disable_event_logging = False,
disable_all_logging = False,
):
self.data_store = data_store
self._environment = None
Expand Down Expand Up @@ -66,7 +66,7 @@ def __init__(
self.logging_interval = logging_interval
self.custom_logger = custom_logger
self.enable_debug_logs = enable_debug_logs
self.disable_event_logging = disable_event_logging
self.disable_all_logging = disable_all_logging
self._set_logging_copy()

def get_logging_copy(self):
Expand Down

0 comments on commit bbd16fd

Please sign in to comment.