Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor d methods to reuse d methods with customized tags #1

Open
darizotas opened this issue Apr 8, 2014 · 1 comment
Open

Refactor d methods to reuse d methods with customized tags #1

darizotas opened this issue Apr 8, 2014 · 1 comment

Comments

@darizotas
Copy link

Avoid repeating logging code (android.util.Log ...) of d methods with the default tag by calling d methods with customized tag. This will give you the flexibility of being able to change the logging library.
Example:
[Current]
static public int d(String m) {
Throwable t = new Throwable();
String logtag = LOG_TAG + ": " + t.getStackTrace()[1].getClassName();
return android.util.Log.wtf(logtag, notEmpty(m));
}

[Proposal]
static public int d(String m) {
Throwable t = new Throwable();
String logtag = LOG_TAG + ": " + t.getStackTrace()[1].getClassName();
return d(logtag, notEmpty(m));
}

I hope this helps.

@b3nn
Copy link
Contributor

b3nn commented May 20, 2014

Interesting idea. I can see how using one centralized logging method would make it quicker to change log levels. Just wondering though in terms of other logging libraries... which others where you thinking?
(PS, forked to my repo since I no longer have commits to this one)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants