This wrapper class adds the ability to turn off logging using a simple boolean flag. It also let's you set a tag in one place, meaning you don't have to type it over and over again throughout your code. The only parameter needed is the String to get logged.
Usage:
Logger.i("this is your log message");
Notice, no repetitive tag parameter!
Custom Logger Class:
package com.pepinonline.common; import android.util.Log; public class Logger { private static final boolean DEBUG = true; private static String TAG = "PEPIN"; public static void d(String string) { if(DEBUG) { Log.d(TAG, string); } } public static void v(String string) { if(DEBUG) { Log.v(TAG, string); } } public static void i(String string) { if(DEBUG) { Log.i(TAG, string); } } public static void e(String string) { if(DEBUG) { Log.e(TAG, string); } } public static void w(String string) { if(DEBUG) { Log.w(TAG, string); } } }