File tree 4 files changed +44
-7
lines changed
4 files changed +44
-7
lines changed Original file line number Diff line number Diff line change
1
+ ========
2
+ Main API
3
+ ========
4
+
5
+ .. inherited-members necessary because of hack for Client and init methods
6
+
7
+ .. automodule :: sentry_sdk
8
+ :members:
9
+ :inherited-members:
Original file line number Diff line number Diff line change @@ -6,8 +6,6 @@ This is the API documentation for `Sentry's Python SDK
6
6
<https://sentry.io/for/python/> `_. For full documentation and other resources
7
7
visit the `GitHub repository <https://github.com/getsentry/sentry-python >`_.
8
8
9
- .. inherited-members necessary because of hack for Client and init methods
10
-
11
- .. automodule :: sentry_sdk
12
- :members:
13
- :inherited-members:
9
+ .. toctree ::
10
+ api
11
+ integrations
Original file line number Diff line number Diff line change
1
+ ============
2
+ Integrations
3
+ ============
4
+
5
+ Logging
6
+ =======
7
+
8
+ .. module :: sentry_sdk.integrations.logging
9
+
10
+ .. autofunction :: ignore_logger
11
+
12
+ .. autoclass :: EventHandler
13
+
14
+ .. autoclass :: BreadcrumbHandler
Original file line number Diff line number Diff line change 27
27
_IGNORED_LOGGERS = set (["sentry_sdk.errors" ])
28
28
29
29
30
- def ignore_logger (name ):
31
- # type: (str) -> None
30
+ def ignore_logger (
31
+ name # type: str
32
+ ):
33
+ # type: (...) -> None
32
34
"""This disables recording (both in breadcrumbs and as events) calls to
33
35
a logger of a specific name. Among other uses, many of our integrations
34
36
use this to prevent their actions being recorded as breadcrumbs. Exposed
35
37
to users as a way to quiet spammy loggers.
38
+
39
+ :param name: The name of the logger to ignore (same string you would pass to ``logging.getLogger``).
36
40
"""
37
41
_IGNORED_LOGGERS .add (name )
38
42
@@ -146,6 +150,12 @@ def _extra_from_record(record):
146
150
147
151
148
152
class EventHandler (logging .Handler , object ):
153
+ """
154
+ A logging handler that emits Sentry events for each log record
155
+
156
+ Note that you do not have to use this class if the logging integration is enabled, which it is by default.
157
+ """
158
+
149
159
def emit (self , record ):
150
160
# type: (LogRecord) -> Any
151
161
with capture_internal_exceptions ():
@@ -204,6 +214,12 @@ def _emit(self, record):
204
214
205
215
206
216
class BreadcrumbHandler (logging .Handler , object ):
217
+ """
218
+ A logging handler that records breadcrumbs for each log record.
219
+
220
+ Note that you do not have to use this class if the logging integration is enabled, which it is by default.
221
+ """
222
+
207
223
def emit (self , record ):
208
224
# type: (LogRecord) -> Any
209
225
with capture_internal_exceptions ():
You can’t perform that action at this time.
0 commit comments