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.41k stars 959 forks source link

TimberArgTypes: wrong detection of measureTimeMillis() return type in Kotlin 1.5 #412

Open hrach opened 3 years ago

hrach commented 3 years ago

After updating to Kotlin 1.5 we receive this lint error, but actually being a false positive.

 Error: Wrong argument type for formatting argument '#1' in connectingPlaces() took %d ms: conversion is 'd', received Object (argument #2 in method call) [TimberArgTypes]
      Timber.d("connectingPlaces() took %d ms", connectingPlaces)

Relevant code:

    val connectingPlaces = measureTimeMillis {
       // ...
    }
    Timber.d("connectingPlaces() took %d ms", connectingPlaces)