JakeWharton / JakeWharton/timber
java.util.UnknownFormatConversionException: Conversion = ';'
- Dominant language
- Kotlin
- Stars
- 10.9k
- Forks
- 994
- Avg merge
- 17h 16m
- Merged PRs (30d)
- 17
Description
Hi!!
I am using Timber on my app, and I use my own HttpLoggingInterceptor to get the logs from OkHttp library that I use it.
I have a request that returns from server with https status code 404, and after that I get this error on logs :
` java.util.UnknownFormatConversionException: Conversion = ';'
at java.util.Formatter$FormatSpecifier.conversion(Formatter.java:2781)
at java.util.Formatter$FormatSpecifier.(Formatter.java:2811)
at java.util.Formatter$FormatSpecifierParser.(Formatter.java:2624)
at java.util.Formatter.parse(Formatter.java:2557)
at java.util.Formatter.format(Formatter.java:2504)
at java.util.Formatter.format(Formatter.java:2458)
at java.lang.String.format(String.java:2770)
at timber.log.Timber$Tree.formatMessage(Timber.java:539)
at timber.log.Timber$Tree.prepareLog(Timber.java:525)
at timber.log.Timber$Tree.d(Timber.java:405)
at timber.log.Timber$1.d(Timber.java:243)
at timber.log.Timber.d(Timber.java:38)
at com.myapp.AndroidLogger.d(AndroidLogger.kt:51)
at com.myapp.LoggingInterceptor.log(LoggingInterceptor.kt:7)
at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:277)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:221)
at okhttp3.RealCall.execute(RealCall.java:81)`
I think it tries to print the response and it is a html content and from there comes this error. Can it be fixed somehow?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at Timber$Tree.formatMessage in Timber.java and trace the call from the application's AndroidLogger.d and LoggingInterceptor.log entries shown in the stack trace. Reproduce logging the 404 response content, then verify that the response can be logged without raising UnknownFormatConversionException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100