Last active
April 25, 2016 16:05
-
-
Save Rexee/24408c684df2c8e98d16d49a80e4cb78 to your computer and use it in GitHub Desktop.
Simple looger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class S { | |
public static final String TAG = "DBG"; | |
public static void L(Context c, Object o) { | |
String txt = o.toString(); | |
Toast.makeText(c, txt, Toast.LENGTH_LONG).show(); | |
Log.d(TAG, txt); | |
} | |
public static void L(String s, Object... args) { | |
Log.d(TAG, String.format(s, args)); | |
} | |
public static void L(Object o) { | |
Log.d(TAG, o.toString()); | |
} | |
public static void L(Throwable t) { | |
Log.d(TAG, "Throw: " + t.getMessage()); | |
} | |
public static void L(Throwable t, String s, Object... args) { | |
Log.d(TAG, "Throw: " + t.getMessage() + ". " + String.format(s, args)); | |
} | |
public static void E(Context context, Throwable error) { | |
Toast.makeText(context, "Error: "+ error.getMessage(), Toast.LENGTH_LONG).show(); | |
S.L(error.getMessage()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment