Skip to content

Fix tag extraction logic, bump to Timber 5.0.1 #4489

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

markushi
Copy link
Member

📜 Description

Timber 5.+ switched to Kotlin, allowing us to directly access the internal tag value, instead of the existing workaround.

According to the release Timber 5.x is binary compatible: https://github.com/JakeWharton/timber/releases/tag/5.0.0 so we should be good with just bumping the version here.

💡 Motivation and Context

Fixes #4484

💚 How did you test it?

Added extra unit tests.

We should still manually test compatibility with Timber 4.x, as the internal tag value was declared the following:

final ThreadLocal<String> explicitTag = new ThreadLocal<>();

And with 5.x it's

@get:JvmSynthetic // Hide from public API.
internal val explicitTag = ThreadLocal<String>()

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Jun 13, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 482.28 ms 524.24 ms 41.96 ms
Size 1.58 MiB 2.09 MiB 518.64 KiB

Previous results on branch: markushi/fix/timber-tag-handling

Startup times

Revision Plain With Sentry Diff
6d73df9 457.70 ms 519.40 ms 61.70 ms
d43b221 438.89 ms 507.69 ms 68.80 ms

App size

Revision Plain With Sentry Diff
6d73df9 1.58 MiB 2.08 MiB 511.33 KiB
d43b221 1.58 MiB 2.08 MiB 511.33 KiB


/** Log a verbose message with optional format args. */
override fun v(
message: String?,
vararg args: Any?
) {
val tag = explicitTag.get()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, but am I missing something or this ain't gonna work for Timber < 5? Because we only define it as compileOnly so if the hosting app is using a lower version it will crash?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sentry <> Timber integration: Missing TimberTag tag
2 participants