Skip to content

Commit

Permalink
Add Sentry error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlong committed Sep 10, 2020
1 parent a3cda48 commit d0a0940
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ VERBOSE=false

# If set, Hubs rooms created by the bot with no scene specified will use this scene/GLTF/GLB/bundle URL as the scene.
DEFAULT_SCENE_URL=https://asset-bundles-prod.reticulum.io/rooms/atrium/Atrium.bundle.json

# Sentry error logging.
SENTRY_DSN=""
1 change: 1 addition & 0 deletions habitat/hooks/run
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export TIMEZONE="{{ cfg.general.timezone }}"
export STATSD_HOST="{{ cfg.general.statsd_host }}"
export STATSD_PREFIX="{{ cfg.general.statsd_prefix }}"
export DEFAULT_SCENE_URL="{{ cfg.general.default_scene_url }}"
export SENTRY_DSN="{{ cfg.general.sentry_dsn }}"

cd {{pkg.svc_path}}

Expand Down
108 changes: 103 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"node": ">=8.0.0"
},
"dependencies": {
"@sentry/node": "^5.23.0",
"bufferutil": "^4.0.1",
"discord.js": "^11.5.1",
"dotenv": "^8.2.0",
Expand Down
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ const dotenv = require("dotenv");
dotenv.config({ path: ".env" });
dotenv.config({ path: ".env.defaults" });

if (process.env.SENTRY_DSN) {
const Sentry = require("@sentry/node");
Sentry.init({ dsn: process.env.SENTRY_DSN });
}

const moment = require('moment-timezone');
const discord = require('discord.js');
const schedule = require('node-schedule');
Expand Down

0 comments on commit d0a0940

Please sign in to comment.