jointakahe / takahe

An ActivityPub/Fediverse server
BSD 3-Clause "New" or "Revised" License
1.1k stars 84 forks source link

use logging instead of sentry.capture_* #646

Closed osmaa closed 9 months ago

osmaa commented 9 months ago

Replace sentry integration's capture_message and capture_exception with Python logging and Sentry's built-in integration to it. This has the following benefits:

andrewgodwin commented 9 months ago

Thanks - seems sensible enough!

kfdm commented 9 months ago

Sorry for the drive by comment, but I'm curious about something.

Typically if you use something like logging.info then it logs everything to the root logger. While not specifically an issue, often it seems better to get an instance of a logger so that the logs also show where in the file things are.

import logging
logger = logging.getLogger(__name__)
...
logger.info('log like usual')
andrewgodwin commented 9 months ago

Yes, that's true, but Sentry's integration has a bit more locality due to the breadcrumb behaviour, so while this PR isn't perfect, it's still an improvement over the previous code!