Skip to content

Instantly share code, notes, and snippets.

@rhonyabdullah
Created April 18, 2016 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhonyabdullah/97985d747e1f57ad35d61a0bdc5a28cc to your computer and use it in GitHub Desktop.
Save rhonyabdullah/97985d747e1f57ad35d61a0bdc5a28cc to your computer and use it in GitHub Desktop.
Android logger class
import android.content.Context;
import android.util.Log;
import android.widget.Toast;
/**
* Created by rhony on 18/04/16.
*/
public class Logger {
public static void log_i(String className, String message) {
Log.i("TAG", " class : "+className+" \nMessage : "+message);
}
public static void log_e(String className, String message) {
Log.e("TAG", " class : "+className+" \nError : "+message);
}
public static void toast(Context context, String message) {
Toast.makeText(context, " "+message , Toast.LENGTH_SHORT).show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment