Skip to content

Use timber instead of printstacktrace - #2792

Merged
davigonz merged 4 commits into
masterfrom
replace_stacktrace_with_timber
Jan 31, 2020
Merged

davigonz merged 4 commits into
masterfrom
replace_stacktrace_with_timber

Conversation

@abelgardep

@abelgardep abelgardep commented Jan 16, 2020 •

Copy link
Copy Markdown
Contributor

} catch (AuthenticatorException e) {
Timber.e(e, "Failed to validate account type " + accountType + ": " + e.getMessage());
e.printStackTrace();
Timber.e(e, "Failed to validate account type %s", accountType);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are duplicating code here, please create a method with:

try {
    validateAccountType(accountType);
} catch (AuthenticatorException e) {
    Timber.e(e, "Failed to validate account type %s", accountType);
    return e.getFailureBundle();
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it is out of this pr scope which is to stop using printStacktrace.

BTW, we are going to refactor this class in the short term future with the new arch. So we can face this kind of problems there. Can't we?

@davigonz davigonz Jan 28, 2020 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to use the boy scout rule (leave the code better than you found it) if the changes are tiny. I thought this was a good example but it looks good to me anyway.

@davigonz

Copy link
Copy Markdown
Contributor

@jesmrec code approved, ready to test

@jesmrec

jesmrec commented Jan 29, 2020

Copy link
Copy Markdown
Member

No much to test here, beyond the basic checks. Timber is making the magic.

Approved.

@davigonz
davigonz force-pushed the replace_stacktrace_with_timber branch from 33731cd to 35e9ac3 Compare January 31, 2020 10:48
@davigonz
davigonz merged commit 0cd98e1 into master Jan 31, 2020
@davigonz
davigonz deleted the replace_stacktrace_with_timber branch January 31, 2020 11:30
@jesmrec jesmrec removed the Sprint label Jan 31, 2020
@hannesa2

Copy link
Copy Markdown
Contributor

@davigonz
Only for the records:
You could get rid of such pointless commits (which are in the history just noise) by using --fixup

Instead of
git commit -m "Rebase with master"

perform a

git commit --fixup 94ed4f6edd3
git rebase -i master --autosquash

@hannesa2

Copy link
Copy Markdown
Contributor

Sorry, I mean this
image

@davigonz

davigonz commented Feb 3, 2020

Copy link
Copy Markdown
Contributor

Thanks for the tip @hannesa2 , I'll give it a try in coming rebases with master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants