- Create a TAG with which you will be logging all the time. Saves memory and time. i.e.
or
public static final String TAG = MyActivityClass.class.getSimpleName();
...
Then in your code:
...
Log.d(TAG, "log this");
One for an entire application, one per activity. As long as it makes sense to you and you can quickly find it.
Additional tips:
Additional tips:
- Setup additional tabs inside of LogCat. These are very useful:
- AndroidRuntime
- System.err
- MediaProvider
- Create a utility class
public final static String TAG = SuperAppLog.class.getSimpleName();
public void error(String message) {
// .. do some app wide logging
// .. redirect to a file
// .. fire off a analytics logging request
// .. etc
}