Comments (4)
This is a programmer error, not a library error. If the library didn't
crash you might never see the error.
On Sun, Sep 6, 2015, 5:40 AM Zordid [email protected] wrote:
I just switched to use Timber in my app - thanks a lot for the library!
One problem I encountered very quickly: if you do the slightest mistake in
a String format and not supply the correct amount of arguments, your app
crashes like this:FATAL EXCEPTION: IntentService[XYZService]
E Process: de.zordid.xyz, PID: 10874
E java.util.MissingFormatArgumentException: Format specifier: tT
E at java.util.Formatter.getArgument(Formatter.java:1111)
E at java.util.Formatter.doFormat(Formatter.java:1076)
E at java.util.Formatter.format(Formatter.java:1042)
E at java.util.Formatter.format(Formatter.java:1011)
E at java.lang.String.format(String.java:1803)
E at java.lang.String.format(String.java:1777)
E at timber.log.Timber$Tree.prepareLog(Timber.java:312)
E at timber.log.Timber$Tree.v(Timber.java:235)
E at timber.log.Timber$1.v(Timber.java:120)
E at timber.log.Timber.v(Timber.java:13)(in this special case I tried to log timestamps and used "%tF %tT%z" but
forgot to double my time argument...Wouldn't it be better if such internal problems when trying to log would
be handled by Timber, preventing the app to crash?
Thanks!ā
Reply to this email directly or view it on GitHub
#69.
from timber.
With all humble respect, Jake... Nobody said, it's a library error...
It would be a very convenient feature of this library to print the format string instead of crashing the whole app if I (the programmer) did a typo in a format string/argument combination.
I often do logging in places that I do not expect to be entered - error/problem cases. These logging instructions are rarely executed. Thus, a typo here is very likely. Why could this library not catch a String.format exception and output the unformatted format string adding "[format exception encountered]"?
from timber.
Oh and by the way, regarding your argument "If the library didn't crash you might never see the error." - I wouldn't care.
If I was interested in the logged output, I would see I have a problem here and fix it - but that's much better than being far away from my PC and not able to go past this logging problem which is not at all a big issue for the rest of the application...
from timber.
Sorry, I don't agree with you.
from timber.
Related Issues (20)
- Lint does not warn if format specifier missing
- š Iād like to add this to the ReadMe Documentation.
- Is it possible to make isLoggable() function public?
- Escape percent symbol? HOT 2
- Is there an MDC like logback? HOT 1
- Getting a parse error when using file logging
- Timber logs not showing in Android Studio Dolphin 2021.3.1 HOT 3
- Want to bypass Lint warning BinaryOperationInTimber HOT 2
- Could not load custom lint check jar
- Make Tree:tag protected instead of internal HOT 4
- Where are the priority codes? HOT 3
- Activo
- Still `new Timber.DebugTree()` cannot be coded in Java HOT 10
- Distribution as a jar artifact HOT 2
- Gftrlgxsi
- Timber.d with %chinese throw UnknownFormatConversionException HOT 1
- https://jakewharton.github.io/timber/docs/5.x/#-1457074065%2FPackages%2F1218876905
- Anyway to add a ignore Class for tag? HOT 1
- Several lint checks not working in Kotlin files, but working ok in Java files
- Timber is triggered more than once even though it's in LaunchEffect HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timber.