Loguru: Sentry breadcrumbs and loguru

Created on 21 Mar 2020  路  4Comments  路  Source: Delgan/loguru

How to make sentry capture breadcrumbs from loguru too?

question

All 4 comments

I don't know much about Sentry. Maybe can you use a custom sink to create breadcrumbs when logs are emitted?

def breadcrumb_sink(message):
    record = message.record
    sentry_sdk.add_breadcrumb(
        category=record["name"],
        message=record["message"],
        level=record["level"].name,
    )

logger.add(breadcrumb_sink)

@heckad Does the provided solution would work? Do you need more help in any way?

Yes, Thanks great! You are the best maintainer!

Ha ha, thanks! :smile:

I'm closing this issue then. :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

af6140 picture af6140  路  5Comments

jonathanhle picture jonathanhle  路  3Comments

lvar picture lvar  路  6Comments

yoonghm picture yoonghm  路  3Comments

HarveySummers picture HarveySummers  路  4Comments