mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Use sentry releases
This commit is contained in:
parent
d788057e15
commit
7d93cd2827
2 changed files with 10 additions and 3 deletions
|
@ -3,6 +3,7 @@ import asyncio
|
||||||
import logging
|
import logging
|
||||||
import sentry_sdk
|
import sentry_sdk
|
||||||
import keyring
|
import keyring
|
||||||
|
import royalnet.version
|
||||||
import royalherald as rh
|
import royalherald as rh
|
||||||
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
|
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
|
||||||
from sentry_sdk.integrations.aiohttp import AioHttpIntegration
|
from sentry_sdk.integrations.aiohttp import AioHttpIntegration
|
||||||
|
@ -151,11 +152,17 @@ class GenericBot:
|
||||||
|
|
||||||
def _init_sentry(self):
|
def _init_sentry(self):
|
||||||
if self.uninitialized_sentry_dsn:
|
if self.uninitialized_sentry_dsn:
|
||||||
log.info("Sentry: enabled")
|
# noinspection PyUnreachableCode
|
||||||
|
if __debug__:
|
||||||
|
release = "DEV"
|
||||||
|
else:
|
||||||
|
release = royalnet.version.semantic
|
||||||
|
log.info(f"Sentry: enabled (Royalnet {release})")
|
||||||
self.sentry = sentry_sdk.init(self.uninitialized_sentry_dsn,
|
self.sentry = sentry_sdk.init(self.uninitialized_sentry_dsn,
|
||||||
integrations=[AioHttpIntegration(),
|
integrations=[AioHttpIntegration(),
|
||||||
SqlalchemyIntegration(),
|
SqlalchemyIntegration(),
|
||||||
LoggingIntegration(event_level=None)])
|
LoggingIntegration(event_level=None)],
|
||||||
|
release=release)
|
||||||
else:
|
else:
|
||||||
log.info("Sentry: disabled")
|
log.info("Sentry: disabled")
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
semantic = "5.0a71"
|
semantic = "5.0a72"
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print(semantic)
|
print(semantic)
|
||||||
|
|
Loading…
Reference in a new issue