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.
```rust let logintegration = sentrylog::LogIntegration::default(); let setry = sentry::init(sentry::ClientOptions::default().addintegration(log_integration));
log::info!("Generates a breadcrumb"); ```
Or optionally with env_logger support:
```rust let mut logbuilder = prettyenvlogger::formattedbuilder(); logbuilder.parsefilters("info"); let logintegration = sentrylog::LogIntegration::default().withenvloggerdest(Some(logbuilder.build())); let setry = sentry::init(sentry::ClientOptions::default().addintegration(log_integration));
log::error!("Generates an event"); ```
License: Apache-2.0