JakeWharton/timber

Timber.d with %chinese throw UnknownFormatConversionException

muedsa opened this issue · 1 comments

I have a proxy class

class LogUtil {
    companion object {
        @JvmStatic
        fun d(message: String?, vararg args: Any?) {
            Timber.d(message, args)
        }
    }
}

example: LogUtil.d("Click %爱")
If args is empty array, get Fatal Exception: java.util.UnknownFormatConversionException Conversion = '爱' and app crash

This is expected, for better or worse. You have to use %% to escape the format specifier. The output always flows into String.format, even when there are no args.