Correct logging

1 vote · 1 comment

Never use senseless debuging levels, Exceptions should always result in ERROR-Level and not debugging level...

raw ·
copy
· download
public class MyApp { private static final String LOG_TAG = MyApp.class.getSimpleName(); public void somethingsWrong() { Object obj = null; try { obj.toString(); } catch (NullPointerException npe) { Log.e(LOG_TAG, "Object is null"); } } }
Add a comment

1 Comment

Reply · March 13, 2012, 7:49 p.m.