JakeWharton / timber

A logger with a small, extensible API which provides utility on top of Android's normal Log class.
https://jakewharton.github.io/timber/docs/5.x/
Apache License 2.0
10.46k stars 962 forks source link

Want to bypass Lint warning BinaryOperationInTimber #475

Closed SunnyBe closed 2 years ago

SunnyBe commented 2 years ago

I am logging a really long string which must/has to be concatenated to pass my max length lint warning. This is the current concatenated multi line that should pass the max length lint warning but fails the BinaryOperationInTimber Timber.i( "$LOG_TAG: install productAsUri has no authority. " + "The second part of the string is this part which is really long=$referrerAsUri" )

But with this below it passes the BinaryOperationInTimber but fails the max length lint warning error Timber.i("$LOG_TAG: install productAsUri has no authority. The second part of the string is this part which is really long=$referrerAsUri")

How do I go about this warning without turning it off for the project?

JakeWharton commented 2 years ago

You should be able to annotate it with @Suppress or @SuppressLint and the "BinaryOperationInTimber" string.

SunnyBe commented 2 years ago

Thank you Jake, this helps. I really hope this use-case is considered in subsequent version. There are a couple of places where I had really long text to log with Timber but I had to suppress them all. Thanks again for the suggestion.