Skip to content

Instantly share code, notes, and snippets.

@kshitijkumar23-zz
Created December 15, 2015 09:52
Show Gist options
  • Save kshitijkumar23-zz/12e2fda072b3931ac950 to your computer and use it in GitHub Desktop.
Save kshitijkumar23-zz/12e2fda072b3931ac950 to your computer and use it in GitHub Desktop.
Wrapper over Log methods to have debug logs without exposing them to release builds
public class AppLogger
{
public static void d(String TAG, String text)
{
if (BuildConfig.DEBUG)
{
Log.d(TAG, text);
}
}
public static void i(String TAG, String text)
{
if (BuildConfig.DEBUG)
{
Log.i(TAG, text);
}
}
public static void e(String TAG, String text)
{
if (BuildConfig.DEBUG)
{
Log.e(TAG, text);
}
}
public static void v(String TAG, String text)
{
if (BuildConfig.DEBUG)
{
Log.v(TAG, text);
}
}
public static void critical(String TAG, String text)
{
Log.e(TAG, text);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment