Skip to content

Commit 2310270

Browse files
committed
docs: Recommend different import style
See #19
1 parent a8bc994 commit 2310270

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

docs/celery.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
Just add ``CeleryIntegration()`` to your ``integrations`` array. For example, in Django:
44

5+
import sentry_sdk
56
from sentry_sdk.integrations.celery import CeleryIntegration
67
from sentry_sdk.integrations.django import DjangoIntegration
7-
from sentry_sdk import init
88

9-
init(dsn="https://[email protected]/123", integrations=[DjangoIntegration(), CeleryIntegration()])
9+
sentry_sdk.init(dsn="https://[email protected]/123", integrations=[DjangoIntegration(), CeleryIntegration()])
1010

1111

1212
With that, the transaction on the event will be set to the task name, and

docs/django.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
In your ``settings.py``:
44

5+
import sentry_sdk
56
from sentry_sdk.integrations.django import DjangoIntegration
6-
from sentry_sdk import init
77

8-
init(dsn="https://[email protected]/123", integrations=[DjangoIntegration()])
8+
sentry_sdk.init(dsn="https://[email protected]/123", integrations=[DjangoIntegration()])
99

1010
* All exceptions are reported.
1111

docs/flask.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Using Sentry with Flask
22

3-
3+
import sentry_sdk
44
from sentry_sdk.integrations.flask import FlaskIntegration
5-
from sentry_sdk import init
65

7-
init(dsn="https://[email protected]/123", integrations=[FlaskIntegration()])
6+
sentry_sdk.init(dsn="https://[email protected]/123", integrations=[FlaskIntegration()])
87

98
app = Flask(__name__)
109

docs/logging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Calling ``sentry_sdk.init()`` already captures any logging message with a level
44
higher than or equal to ``INFO``. You can change this behavior by explicitly
55
passing the logging integration like any other:
66

7+
import sentry_sdk
78
from sentry_sdk.integrations.logging import LoggingIntegration
8-
from sentry_sdk import init
99

1010
sentry_logging = LoggingIntegration(
1111
level=logging.DEBUG,
1212
event_level=logging.ERROR
1313
)
14-
init(dsn="https://[email protected]/123", integrations=[sentry_logging])
14+
sentry_sdk.init(dsn="https://[email protected]/123", integrations=[sentry_logging])
1515

1616
The above configuration captures *all* messages, now including ``DEBUG``, as
1717
breadcrumbs. Messages with level ``ERROR`` and above will show up as their own

0 commit comments

Comments
 (0)