Giter Club home page Giter Club logo

Comments (5)

JakeWharton avatar JakeWharton commented on June 8, 2024

Actually I don't know why this doesn't trigger. It runs first...

from timber.

jrodbx avatar jrodbx commented on June 8, 2024

Currently, both TimberArgCount and ThrowableNotAtBeginning are thrown for this example.

Do we still want to remove TimberArgCount here and behave like String.format(...) (which ignores extra arguments)?

from timber.

JakeWharton avatar JakeWharton commented on June 8, 2024

I still want to fail on extra arguments. Maybe ignore a single extra argument if its type is a subclass of Throwable and it's last?

I'm fine with both being triggered, but I'd prefer not to send mixed messages.

from timber.

jrodbx avatar jrodbx commented on June 8, 2024

Maybe ignore a single extra argument if its type is a subclass of Throwable and it's last?

Here's how that would look:

Timber.d("Failed", e);                    // fail: ThrowableNotAtBeginning
Timber.d("Failed %s", "s", e);            // fail: ThrowableNotAtBeginning
Timber.d("Failed %s", e, "s");            // fail: ThrowableNotAtBeginning AND TimberArgCount
Timber.d("Failed %s %s", e, "s1", "s2");  // fail: ThrowableNotAtBeginning AND TimberArgCount
Timber.d("Failed %s %s", "s1", e, "s2");  // fail: ThrowableNotAtBeginning AND TimberArgCount
Timber.d("Failed %s %s", "s1", "s2", e);  // fail: ThrowableNotAtBeginning

Adding the last argument constraint might be confusing. WDYT?

from timber.

JakeWharton avatar JakeWharton commented on June 8, 2024

The reasons the check exists is because Android's Log accepts the throwable at the end instead of the start. In your examples I would think that only TimberArgCount would run for the three examples where both are currently running.

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.