Skip to content

Commit

Permalink
release: 0.21.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed Nov 12, 2020
1 parent 0b42249 commit 1541cbf
Show file tree
Hide file tree
Showing 22 changed files with 122 additions and 126 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## Unreleased
## 0.21.0

**Breaking Changes**:

Expand Down
6 changes: 3 additions & 3 deletions sentry-actix/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sentry-actix"
version = "0.20.1"
version = "0.21.0"
authors = ["Sentry <hello@sentry.io>"]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -12,11 +12,11 @@ Sentry client extension for actix-web 3.
edition = "2018"

[dependencies]
sentry-core = { version = "0.20.1", path = "../sentry-core", default-features = false }
sentry-core = { version = "0.21.0", path = "../sentry-core", default-features = false }
actix-web = { version = "3", default-features = false }
futures-util = "0.3.5"

[dev-dependencies]
sentry = { version = "0.20.1", path = "../sentry", default-features = false, features = ["test"] }
sentry = { version = "0.21.0", path = "../sentry", default-features = false, features = ["test"] }
actix-rt = "1.1.1"
futures = "0.3"
17 changes: 2 additions & 15 deletions sentry-actix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ async fn failing(_req: HttpRequest) -> Result<String, Error> {
Err(io::Error::new(io::ErrorKind::Other, "An error happens here").into())
}

#[get("/hello")]
async fn hello_world(_req: HttpRequest) -> Result<String, Error> {
sentry::capture_message("Something is not well", Level::Warning);
Ok("Hello World".into())
}

#[actix_web::main]
async fn main() -> io::Result<()> {
let _guard = sentry::init(());
Expand All @@ -43,7 +37,6 @@ async fn main() -> io::Result<()> {
App::new()
.wrap(sentry_actix::Sentry::new())
.service(failing)
.service(hello_world)
})
.bind("127.0.0.1:3001")?
.run()
Expand All @@ -53,20 +46,14 @@ async fn main() -> io::Result<()> {
}
```

# Reusing the Hub
## Reusing the Hub

This integration will automatically update the current Hub instance. For example,
the following will capture a message in the current request's Hub:

```rust
use actix_web::{Error, get, HttpRequest};
use sentry::Level;

#[get("/")]
async fn hello_world(_req: HttpRequest) -> Result<String, Error> {
sentry::capture_message("Something is not well", Level::Warning);
Ok("Hello World".into())
}
sentry::capture_message("Something is not well", Level::Warning);
```

## Resources
Expand Down
6 changes: 3 additions & 3 deletions sentry-anyhow/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sentry-anyhow"
version = "0.20.1"
version = "0.21.0"
authors = ["Sentry <hello@sentry.io>"]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -15,8 +15,8 @@ edition = "2018"
all-features = true

[dependencies]
sentry-core = { version = "0.20.1", path = "../sentry-core" }
sentry-core = { version = "0.21.0", path = "../sentry-core" }
anyhow = "1.0.30"

[dev-dependencies]
sentry = { version = "0.20.1", path = "../sentry", default-features = false, features = ["test"] }
sentry = { version = "0.21.0", path = "../sentry", default-features = false, features = ["test"] }
15 changes: 8 additions & 7 deletions sentry-anyhow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ Adds support for capturing Sentry errors from `anyhow::Error`.

```rust
use sentry_anyhow::capture_anyhow;
let result = match function_that_might_fail() {
Ok(result) => result,
Err(err) => {
capture_anyhow(&err);
return Err(err);
}
};

fn function_that_might_fail() -> anyhow::Result<()> {
Err(anyhow::anyhow!("some kind of error"))
}

if let Err(err) = function_that_might_fail() {
capture_anyhow(&err);
}
```

## Resources
Expand Down
4 changes: 2 additions & 2 deletions sentry-backtrace/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sentry-backtrace"
version = "0.20.1"
version = "0.21.0"
authors = ["Sentry <hello@sentry.io>"]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -15,7 +15,7 @@ edition = "2018"
all-features = true

[dependencies]
sentry-core = { version = "0.20.1", path = "../sentry-core" }
sentry-core = { version = "0.21.0", path = "../sentry-core" }
lazy_static = "1.4.0"
backtrace = "0.3.44"
regex = "1.3.4"
6 changes: 3 additions & 3 deletions sentry-contexts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sentry-contexts"
version = "0.20.1"
version = "0.21.0"
authors = ["Sentry <hello@sentry.io>"]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -16,7 +16,7 @@ edition = "2018"
all-features = true

[dependencies]
sentry-core = { version = "0.20.1", path = "../sentry-core" }
sentry-core = { version = "0.21.0", path = "../sentry-core" }
libc = "0.2.66"
hostname = "0.3.0"
regex = "1.3.4"
Expand All @@ -29,4 +29,4 @@ uname = "0.1.1"
rustc_version = "0.2.3"

[dev-dependencies]
sentry = { version = "0.20.1", path = "../sentry", default-features = false, features = ["test"] }
sentry = { version = "0.21.0", path = "../sentry", default-features = false, features = ["test"] }
7 changes: 2 additions & 5 deletions sentry-contexts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ See the [Contexts Interface] documentation for more info.
## Examples

```rust
let integration = sentry_contexts::ContextIntegration {
add_os: false,
..Default::default()
};
let _sentry = sentry::init(sentry::ClientOptions::default().add_integration(integration));
let integration = sentry_contexts::ContextIntegration::new().add_os(false);
let _sentry = sentry::init(sentry::ClientOptions::new().add_integration(integration));
```

[Contexts Interface]: https://develop.sentry.dev/sdk/event-payloads/contexts/
Expand Down
6 changes: 3 additions & 3 deletions sentry-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sentry-core"
version = "0.20.1"
version = "0.21.0"
authors = ["Sentry <hello@sentry.io>"]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -23,7 +23,7 @@ debug-logs = ["log_"]
test = ["client"]

[dependencies]
sentry-types = { version = "0.20.1", path = "../sentry-types" }
sentry-types = { version = "0.21.0", path = "../sentry-types" }
serde = { version = "1.0.104", features = ["derive"] }
lazy_static = "1.4.0"
im = { version = "15.0.0", optional = true }
Expand All @@ -35,7 +35,7 @@ log_ = { package = "log", version = "0.4.8", optional = true, features = ["std"]
# Because we re-export all the public API in `sentry`, we actually run all the
# doctests using the `sentry` crate. This also takes care of the doctest
# limitation documented in https://github.com/rust-lang/rust/issues/45599.
sentry = { version = "0.20.1", path = "../sentry", default-features = false, features = ["test"] }
sentry = { version = "0.21.0", path = "../sentry", default-features = false, features = ["test"] }
thiserror = "1.0.15"
anyhow = "1.0.30"
failure = "0.1.8"
Expand Down
14 changes: 7 additions & 7 deletions sentry-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ functionality.

[`sentry`]: https://crates.io/crates/sentry
[Unified API]: https://develop.sentry.dev/sdk/unified-api/
[`Client`]: https://docs.rs/sentry-core/0.20.1/sentry_core/struct.Client.html
[`Hub`]: https://docs.rs/sentry-core/0.20.1/sentry_core/struct.Hub.html
[`Scope`]: https://docs.rs/sentry-core/0.20.1/sentry_core/struct.Scope.html
[`Integration`]: https://docs.rs/sentry-core/0.20.1/sentry_core/trait.Integration.html
[`Transport`]: https://docs.rs/sentry-core/0.20.1/sentry_core/trait.Transport.html
[`TransportFactory`]: https://docs.rs/sentry-core/0.20.1/sentry_core/trait.TransportFactory.html
[`test`]: https://docs.rs/sentry-core/0.20.1/sentry_core/test/index.html
[`Client`]: https://docs.rs/sentry-core/0.21.0/sentry_core/struct.Client.html
[`Hub`]: https://docs.rs/sentry-core/0.21.0/sentry_core/struct.Hub.html
[`Scope`]: https://docs.rs/sentry-core/0.21.0/sentry_core/struct.Scope.html
[`Integration`]: https://docs.rs/sentry-core/0.21.0/sentry_core/trait.Integration.html
[`Transport`]: https://docs.rs/sentry-core/0.21.0/sentry_core/trait.Transport.html
[`TransportFactory`]: https://docs.rs/sentry-core/0.21.0/sentry_core/trait.TransportFactory.html
[`test`]: https://docs.rs/sentry-core/0.21.0/sentry_core/test/index.html

## Resources

Expand Down
4 changes: 2 additions & 2 deletions sentry-debug-images/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sentry-debug-images"
version = "0.20.1"
version = "0.21.0"
authors = ["Sentry <hello@sentry.io>"]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -15,6 +15,6 @@ edition = "2018"
all-features = true

[dependencies]
sentry-core = { version = "0.20.1", path = "../sentry-core" }
sentry-core = { version = "0.21.0", path = "../sentry-core" }
lazy_static = "1.4.0"
findshlibs = "0.7.0"
19 changes: 11 additions & 8 deletions sentry-debug-images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@

The Sentry Debug Images Integration.

The `DebugImagesIntegration` adds metadata about the loaded shared libraries
to Sentry `Event`s.
The [`DebugImagesIntegration`] adds metadata about the loaded shared
libraries to Sentry [`Event`]s.

This Integration only works on Unix-like OSs right now. Support for Windows
will be added in the future.

## Configuration

The integration by default attaches this information to all Events, but a
custom filter can be defined as well.
The integration by default attaches this information to all [`Event`]s, but
a custom filter can be defined as well.

```rust
use sentry_core::Level;
let integration = sentry_debug_images::DebugImagesIntegration {
filter: Box::new(|event| event.level >= Level::Warning),
..Default::default()
};
let integration = sentry_debug_images::DebugImagesIntegration::new()
.filter(|event| event.level >= Level::Warning);
```

[`Event`]: https://docs.rs/sentry-debug-images/0.21.0/sentry_debug-images/sentry_core::protocol::Event

## Resources

License: Apache-2.0
Expand Down
8 changes: 4 additions & 4 deletions sentry-error-chain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sentry-error-chain"
version = "0.20.1"
version = "0.21.0"
authors = ["Sentry <hello@sentry.io>"]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -15,9 +15,9 @@ edition = "2018"
all-features = true

[dependencies]
sentry-core = { version = "0.20.1", path = "../sentry-core" }
sentry-backtrace = { version = "0.20.1", path = "../sentry-backtrace" }
sentry-core = { version = "0.21.0", path = "../sentry-core" }
sentry-backtrace = { version = "0.21.0", path = "../sentry-backtrace" }
error-chain = "0.12.1"

[dev-dependencies]
sentry = { version = "0.20.1", path = "../sentry", default-features = false, features = ["test"] }
sentry = { version = "0.21.0", path = "../sentry", default-features = false, features = ["test"] }
10 changes: 5 additions & 5 deletions sentry-failure/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sentry-failure"
version = "0.20.1"
version = "0.21.0"
authors = ["Sentry <hello@sentry.io>"]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -15,10 +15,10 @@ edition = "2018"
all-features = true

[dependencies]
sentry-core = { version = "0.20.1", path = "../sentry-core" }
sentry-backtrace = { version = "0.20.1", path = "../sentry-backtrace" }
sentry-core = { version = "0.21.0", path = "../sentry-core" }
sentry-backtrace = { version = "0.21.0", path = "../sentry-backtrace" }
failure = "0.1.6"

[dev-dependencies]
sentry = { version = "0.20.1", path = "../sentry", default-features = false, features = ["test"] }
sentry-panic = { version = "0.20.1", path = "../sentry-panic" }
sentry = { version = "0.21.0", path = "../sentry", default-features = false, features = ["test"] }
sentry-panic = { version = "0.21.0", path = "../sentry-panic" }
6 changes: 3 additions & 3 deletions sentry-log/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sentry-log"
version = "0.20.1"
version = "0.21.0"
authors = ["Sentry <hello@sentry.io>"]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -12,9 +12,9 @@ Sentry integration for log and env_logger crates.
edition = "2018"

[dependencies]
sentry-core = { version = "0.20.1", path = "../sentry-core" }
sentry-core = { version = "0.21.0", path = "../sentry-core" }
log = { version = "0.4.8", features = ["std"] }

[dev-dependencies]
sentry = { version = "0.20.1", path = "../sentry", default-features = false, features = ["test"] }
sentry = { version = "0.21.0", path = "../sentry", default-features = false, features = ["test"] }
pretty_env_logger = "0.4.0"
25 changes: 16 additions & 9 deletions sentry-log/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,29 @@ anything above `Error` is captured as error event.
## Examples

```rust
let log_integration = sentry_log::LogIntegration::default();
let _sentry = sentry::init(sentry::ClientOptions::default().add_integration(log_integration));
let mut log_builder = pretty_env_logger::formatted_builder();
log_builder.parse_filters("info");
let logger = sentry_log::SentryLogger::with_dest(log_builder.build());

log::set_boxed_logger(Box::new(logger)).unwrap();
log::set_max_level(log::LevelFilter::Info);

let _sentry = sentry::init(());

log::info!("Generates a breadcrumb");
log::error!("Generates an event");
```

Or optionally with env_logger support:
Or one might also set an explicit filter, to customize how to treat log
records:

```rust
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));
use sentry_log::LogFilter;

log::error!("Generates an event");
let logger = sentry_log::SentryLogger::new().filter(|md| match md.level() {
log::Level::Error => LogFilter::Event,
_ => LogFilter::Ignore,
});
```

## Resources
Expand Down
8 changes: 4 additions & 4 deletions sentry-panic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sentry-panic"
version = "0.20.1"
version = "0.21.0"
authors = ["Sentry <hello@sentry.io>"]
license = "Apache-2.0"
readme = "README.md"
Expand All @@ -15,8 +15,8 @@ edition = "2018"
all-features = true

[dependencies]
sentry-core = { version = "0.20.1", path = "../sentry-core" }
sentry-backtrace = { version = "0.20.1", path = "../sentry-backtrace" }
sentry-core = { version = "0.21.0", path = "../sentry-core" }
sentry-backtrace = { version = "0.21.0", path = "../sentry-backtrace" }

[dev-dependencies]
sentry = { version = "0.20.1", path = "../sentry", default-features = false, features = ["test"] }
sentry = { version = "0.21.0", path = "../sentry", default-features = false, features = ["test"] }
Loading

0 comments on commit 1541cbf

Please sign in to comment.