4 releases

new 0.20.1 Sep 15, 2020
0.20.0 Sep 9, 2020
0.19.1 Aug 28, 2020
0.19.0 Jun 18, 2020
Download history 38/week @ 2020-06-18 202/week @ 2020-06-25 348/week @ 2020-07-02 300/week @ 2020-07-09 405/week @ 2020-07-16 291/week @ 2020-07-23 279/week @ 2020-07-30 497/week @ 2020-08-06 488/week @ 2020-08-13 532/week @ 2020-08-20 785/week @ 2020-08-27 793/week @ 2020-09-03 958/week @ 2020-09-10

1,881 downloads per month
Used in 2 crates (via sentry)

Apache-2.0

130KB
2.5K SLoC

Sentry Rust SDK: sentry-log

Adds support for automatic Breadcrumb and Event capturing from logs.

The log crate is supported in two ways. First, logs can be captured as breadcrumbs for later. Secondly, error logs can be captured as events to Sentry. By default anything above Info is recorded as breadcrumb and anything above Error is captured as error event.

Examples

let log_integration = sentry_log::LogIntegration::default();
let _sentry = sentry::init(sentry::ClientOptions::default().add_integration(log_integration));

log::info!("Generates a breadcrumb");

Or optionally with env_logger support:

let mut log_builder = pretty_env_logger::formatted_builder();
log_builder.parse_filters("info");
let log_integration =
    sentry_log::LogIntegration::default().with_env_logger_dest(Some(log_builder.build()));
let _sentry = sentry::init(sentry::ClientOptions::default().add_integration(log_integration));

log::error!("Generates an event");

Resources

License: Apache-2.0

Dependencies

~5–6.5MB
~154K SLoC