Closed muedsa closed 7 months ago
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
LogUtil.d("Click %爱")
args
Fatal Exception: java.util.UnknownFormatConversionException Conversion = '爱'
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.
String.format
I have a proxy class
example:
LogUtil.d("Click %爱")
Ifargs
is empty array, getFatal Exception: java.util.UnknownFormatConversionException Conversion = '爱'
and app crash