Skip to content

Commit

Permalink
chore: replace several dependencies of sentry by sentry-core and sent…
Browse files Browse the repository at this point in the history
…ry-log
  • Loading branch information
yangby-cryptape committed Sep 8, 2020
1 parent e6b00c5 commit 80af819
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ p2p = { version="0.3.0", package="tentacle", features = ["molc"] }
faketime = "0.2.0"
lazy_static = "1.3.0"
bs58 = "0.3.0"
sentry = "0.19.1"
sentry-core = "0.19.1"
faster-hex = "0.4"
ckb-hash = {path = "../util/hash"}
secp256k1 = {version = "0.17", features = ["recovery"] }
Expand Down
4 changes: 2 additions & 2 deletions network/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ impl NetworkState {
addr
);
if dial_started.elapsed() > DIAL_HANG_TIMEOUT {
use sentry::{capture_message, with_scope, Level};
use sentry_core::{capture_message, with_scope, Level};
with_scope(
|scope| scope.set_fingerprint(Some(&["ckb-network", "dialing-timeout"])),
|| {
Expand Down Expand Up @@ -640,7 +640,7 @@ impl<T: ExitHandler> ServiceHandle for EventHandler<T> {
}
ServiceError::ProtocolHandleError { proto_id, error } => {
debug!("ProtocolHandleError: {:?}, proto_id: {}", error, proto_id);
use sentry::{capture_message, with_scope, Level};
use sentry_core::{capture_message, with_scope, Level};
with_scope(
|scope| scope.set_fingerprint(Some(&["ckb-network", "p2p-service-error"])),
|| {
Expand Down
2 changes: 1 addition & 1 deletion sync/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ckb-channel = { path = "../util/channel" }
ckb-traits = { path = "../traits" }
failure = "0.1.5"
lru-cache = { git = "https://github.com/nervosnetwork/lru-cache", rev = "a35fdb8" }
sentry = "0.19.1"
sentry-core = "0.19.1"
futures = "0.3"
ckb-error = {path = "../error"}
ckb-tx-pool = { path = "../tx-pool" }
Expand Down
2 changes: 1 addition & 1 deletion sync/src/relayer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ impl CKBProtocolHandler for Relayer {
msg.item_name(),
peer_index
);
let sentry_hub = sentry::Hub::current();
let sentry_hub = sentry_core::Hub::current();
let _scope_guard = sentry_hub.push_scope();
sentry_hub.configure_scope(|scope| {
scope.set_tag("p2p.protocol", "relayer");
Expand Down
2 changes: 1 addition & 1 deletion sync/src/relayer/transactions_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use ckb_types::{
use ckb_util::LinkedHashSet;
use ckb_verification::cache::CacheEntry;
use ckb_verification::TransactionError;
use sentry::{capture_message, with_scope, Level};
use sentry_core::{capture_message, with_scope, Level};
use std::sync::Arc;
use std::time::Duration;

Expand Down
2 changes: 1 addition & 1 deletion sync/src/synchronizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ impl CKBProtocolHandler for Synchronizer {
};

debug!("received msg {} from {}", msg.item_name(), peer_index);
let sentry_hub = sentry::Hub::current();
let sentry_hub = sentry_core::Hub::current();
let _scope_guard = sentry_hub.push_scope();
sentry_hub.configure_scope(|scope| {
scope.set_tag("p2p.protocol", "synchronizer");
Expand Down
3 changes: 2 additions & 1 deletion util/logger-service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ once_cell = "1.3.1"
regex = "1.1.6"
chrono = "0.4"
backtrace = "0.3"
sentry = { version = "0.19.1", features = ["log"] }
sentry-core = "0.19.1"
sentry-log = "0.19.1"
3 changes: 2 additions & 1 deletion util/logger-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ impl Log for Logger {
.collect::<Vec<_>>();
if is_match || !extras.is_empty() {
if self.emit_sentry_breadcrumbs {
use sentry::{add_breadcrumb, integrations::log::breadcrumb_from_record};
use sentry_core::add_breadcrumb;
use sentry_log::breadcrumb_from_record;
add_breadcrumb(|| breadcrumb_from_record(record));
}

Expand Down

0 comments on commit 80af819

Please sign in to comment.