intrepidusgroup / IGLogger

Class to help with adding logging function in smali output from 3rd party Android apps.
77 stars 33 forks source link

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

Open darizotas opened 10 years ago

darizotas commented 10 years ago

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 commented 10 years ago

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)