Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sentry-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ harness = false
default = []
client = ["rand"]
test = ["client", "release-health"]
debug_logs = []
release-health = []
logs = []

Expand Down
1 change: 0 additions & 1 deletion sentry-core/src/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ impl LogsBatcher {
}

sentry_debug!("[LogsBatcher] Flushing {} logs", logs.len());

if let Some(ref transport) = *transport.read().unwrap() {
let mut envelope = Envelope::new();
let logs_item: EnvelopeItem = logs.into();
Expand Down
11 changes: 11 additions & 0 deletions sentry-core/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ macro_rules! with_client_impl {
// TODO: temporarily exported for use in `sentry` crate
#[macro_export]
#[doc(hidden)]
#[cfg(feature = "debug_logs")]
macro_rules! sentry_debug {
($($arg:tt)*) => {
$crate::Hub::with(|hub| {
Expand All @@ -64,6 +65,16 @@ macro_rules! sentry_debug {
}
}

/// Replace the exported macro with a no-op macro when debug_logs is disabled.
#[macro_export]
#[doc(hidden)]
#[cfg(not(feature = "debug_logs"))]
macro_rules! sentry_debug {
($($arg:tt)*) => {
();
};
}

#[allow(unused_macros)]
macro_rules! minimal_unreachable {
() => {
Expand Down
3 changes: 3 additions & 0 deletions sentry-log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@
//!
//! let logger = sentry_log::SentryLogger::new().filter(|md| match md.level() {
//! log::Level::Error => LogFilter::Event,
//! #[cfg(feature = "logs")]
//! log::Level::Warn => LogFilter::Breadcrumb | LogFilter::Log,
//! #[cfg(not(feature = "logs"))]
//! log::Level::Warn => LogFilter::Breadcrumb,
//! _ => LogFilter::Ignore,
//! });
//! ```
Expand Down
1 change: 1 addition & 0 deletions sentry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ opentelemetry = ["sentry-opentelemetry"]
test = ["sentry-core/test"]
release-health = ["sentry-core/release-health", "sentry-actix?/release-health"]
logs = ["sentry-core/logs", "sentry-tracing?/logs", "sentry-log?/logs"]
debug_logs = ["sentry-core/debug_logs"]
# transports
transport = ["reqwest", "native-tls"]
reqwest = ["dep:reqwest", "httpdate", "tokio"]
Expand Down
Loading