GithubHelp home page GithubHelp logo

Comments (4)

JakeWharton avatar JakeWharton commented on August 24, 2024

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.

Zordid avatar Zordid commented on August 24, 2024

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.

Zordid avatar Zordid commented on August 24, 2024

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.

JakeWharton avatar JakeWharton commented on August 24, 2024

Sorry, I don't agree with you.

from timber.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.