Skip to content

Commit ca56ba8

Browse files
authored
enabling Rollbar (#181)
1 parent 725a94c commit ca56ba8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

app.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
from flask.views import MethodView
2424
from flask_sqlalchemy import SQLAlchemy
2525
from decouple import config
26+
import rollbar
2627

2728

2829
DEBUG = config("DEBUG", default=False)
@@ -38,6 +39,14 @@
3839
else:
3940
warnings.warn("GITHUB_AUTH_TOKEN is NOT available. Worry about rate limits.")
4041

42+
ROLLBAR_ACCESS_TOKEN = config("ROLLBAR_ACCESS_TOKEN", default=None)
43+
if ROLLBAR_ACCESS_TOKEN:
44+
rollbar.init(ROLLBAR_ACCESS_TOKEN)
45+
rollbar.report_message("Rollbar is configured correctly")
46+
print("Rollbar enabled.")
47+
else:
48+
print("Rollbar NOT enabled.")
49+
4150
# Set static_folder=None to suppress the standard static server
4251
app = Flask(__name__, static_folder=None)
4352
app.config["SQLALCHEMY_DATABASE_URI"] = config(

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ python-decouple==3.3 \
4545
python-dotenv==0.12.0 \
4646
--hash=sha256:81822227f771e0cab235a2939f0f265954ac4763cafd806d845801c863bf372f \
4747
--hash=sha256:92b3123fb2d58a284f76cc92bfe4ee6c502c32ded73e8b051c4f6afc8b6751ed
48+
rollbar==0.15.1 \
49+
--hash=sha256:96b63df27a47232aa16a142d2f5812073f8bf7db2b81c5f7981b9a4d4659468c

0 commit comments

Comments
 (0)