Skip to content

Instantly share code, notes, and snippets.

@mitchwongho
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save mitchwongho/e130fc22cde13868cb55 to your computer and use it in GitHub Desktop.

Select an option

Save mitchwongho/e130fc22cde13868cb55 to your computer and use it in GitHub Desktop.
Convenience android.util.Log wrapper
package com.utils;
/**
* Convenience Log wrapper
*/
public class Log {
public static void d( final String tag, final String msg, final Object... vargs ) {
android.util.Log.d( tag, String.format( msg, vargs ) );
}
public static void d( final String tag, final String msg, final Throwable throwable, final Object... vargs ) {
android.util.Log.d( tag, String.format( msg, vargs ), throwable );
}
public static void w( final String tag, final String msg, final Object... vargs ) {
android.util.Log.w( tag, String.format( msg, vargs ) );
}
public static void w( final String tag, final String msg, final Throwable throwable, final Object... vargs ) {
android.util.Log.w( tag, String.format( msg, vargs ), throwable );
}
public static void e( final String tag, final String msg, final Object... vargs ) {
android.util.Log.e( tag, String.format( msg, vargs ) );
}
public static void e( final String tag, final String msg, final Throwable throwable, final Object... vargs ) {
android.util.Log.e( tag, String.format( msg, vargs ), throwable );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment