Skip to content

Commit

Permalink
fix: Timber throwing on args usage (#1986)
Browse files Browse the repository at this point in the history
  • Loading branch information
romtsn authored Apr 13, 2022
1 parent ed3d4e8 commit f0786d3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

* Fix: Sentry Timber integration throws an exception when using args (#1986)

## 5.7.2

* Fix: bring back support for `Timber.tag` ([#1974](https://github.com/getsentry/sentry-java/pull/1974))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class SentryTimberTree(
message: String?,
vararg args: Any?
) {
super.v(t, message, args)
super.v(t, message, *args)
logWithSentry(Log.VERBOSE, t, message, *args)
}

Expand All @@ -57,7 +57,7 @@ class SentryTimberTree(
message: String?,
vararg args: Any?
) {
super.d(message, args)
super.d(message, *args)
logWithSentry(Log.DEBUG, null, message, *args)
}

Expand All @@ -67,7 +67,7 @@ class SentryTimberTree(
message: String?,
vararg args: Any?
) {
super.d(t, message, args)
super.d(t, message, *args)
logWithSentry(Log.DEBUG, t, message, *args)
}

Expand All @@ -82,7 +82,7 @@ class SentryTimberTree(
message: String?,
vararg args: Any?
) {
super.d(message, args)
super.d(message, *args)
logWithSentry(Log.INFO, null, message, *args)
}

Expand All @@ -92,7 +92,7 @@ class SentryTimberTree(
message: String?,
vararg args: Any?
) {
super.i(t, message, args)
super.i(t, message, *args)
logWithSentry(Log.INFO, t, message, *args)
}

Expand All @@ -107,7 +107,7 @@ class SentryTimberTree(
message: String?,
vararg args: Any?
) {
super.w(message, args)
super.w(message, *args)
logWithSentry(Log.WARN, null, message, *args)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,10 @@ class SentryTimberTreeTest {
sut.e(Throwable())
verify(fixture.hub, never()).addBreadcrumb(any<Breadcrumb>())
}

@Test
fun `Tree does not throw when using log with args`() {
val sut = fixture.getSut()
sut.d("test %s, %s", 1, 1)
}
}

0 comments on commit f0786d3

Please sign in to comment.