Add encvironment variable to Sentry crash logging

CURA-7050
This commit is contained in:
Nino van Hooff 2019-12-19 09:45:35 +01:00
parent 4de28bed28
commit 8dc6e7a386

View File

@ -23,7 +23,18 @@ parser.add_argument("--debug",
)
known_args = vars(parser.parse_known_args()[0])
sentry_env = "production"
if ApplicationMetadata.CuraVersion == "master":
sentry_env = "development"
try:
if ApplicationMetadata.CuraVersion.split(".")[2] == "99":
sentry_env = "nightly"
except IndexError:
pass
sentry_sdk.init("https://5034bf0054fb4b889f82896326e79b13@sentry.io/1821564",
environment = sentry_env,
release = "cura%s" % ApplicationMetadata.CuraVersion,
default_integrations = False,
max_breadcrumbs = 200)