Skip to content

Commit

Permalink
Fix: Sentry Timber integration does not submit msg.formatted breadcru…
Browse files Browse the repository at this point in the history
…mbs (#1957)
  • Loading branch information
marandaneto committed Mar 23, 2022
1 parent d102908 commit 060811b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

* Fix: Sentry Timber integration does not submit msg.formatted breadcrumbs (#)

## 5.7.0

* Feat: Automatically enable `Timber` and `Fragment` integrations if they are present on the classpath (#1936)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class SentryTimberTree(
msg.message != null -> Breadcrumb().apply {
level = sentryLevel
category = "Timber"
message = msg.message
message = msg.formatted ?: msg.message
}
throwableMsg != null -> Breadcrumb.error(throwableMsg).apply {
category = "exception"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,18 @@ class SentryTimberTreeTest {
)
}

@Test
fun `Tree adds a breadcrumb with formatted message and arguments, when provided`() {
val sut = fixture.getSut()
sut.e("test count: %d", 32)

verify(fixture.hub).addBreadcrumb(
check<Breadcrumb> {
assertEquals("test count: 32", it.message)
}
)
}

@Test
fun `Tree adds a breadcrumb if min level is equal`() {
val sut = fixture.getSut()
Expand Down

0 comments on commit 060811b

Please sign in to comment.