Skip to content

feat(core): emit debug log when calling capture_log but logs are disabled #849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2025
Merged
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
- It's also possible to use `EventMapping::Combined` to map a `tracing` event to multiple items in Sentry.
- `ctx` in the signatures of `event_from_event`, `breadcrumb_from_event` and `log_from_event` has been changed to take `impl Into<Option<&'context Context<'context, S>>>` to avoid cloning the `Context` when mapping to multiple items.

### Features

- feat(core): emit debug log when calling capture_log but logs are disabled (#849) by @lcian

### Fixes

- fix(logs): stringify u64 attributes greater than `i64::MAX` (#846) by @lcian
Expand Down
3 changes: 2 additions & 1 deletion sentry-core/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ impl Client {
/// Captures a log and sends it to Sentry.
#[cfg(feature = "logs")]
pub fn capture_log(&self, log: Log, scope: &Scope) {
if !self.options().enable_logs {
if !self.options.enable_logs {
sentry_debug!("[Client] called capture_log, but options.enable_logs is set to false");
return;
}
if let Some(log) = self.prepare_log(log, scope) {
Expand Down