Created
September 20, 2013 11:40
-
-
Save alexoro/6636276 to your computer and use it in GitHub Desktop.
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 DefaultLog implements Log { | |
public static final String DEFAULT_TAG = "Ln"; | |
private String mDefaultTag; | |
public DefaultLog(String defaultTag) { | |
mDefaultTag = defaultTag; | |
} | |
public DefaultLog() { | |
mDefaultTag = DEFAULT_TAG; | |
} | |
public void v(String tag, String message) { | |
android.util.Log.v(tag, message); | |
} | |
public void v(String message) { | |
android.util.Log.v(mDefaultTag, message); | |
} | |
public void d(String tag, String message) { | |
android.util.Log.d(tag, message); | |
} | |
public void d(String message) { | |
android.util.Log.d(mDefaultTag, message); | |
} | |
public void w(String tag, String message) { | |
android.util.Log.w(tag, message); | |
} | |
public void w(String tag, String message, Throwable ex) { | |
android.util.Log.w(tag, message, ex); | |
} | |
public void w(String message) { | |
android.util.Log.w(mDefaultTag, message); | |
} | |
public void w(String message, Throwable ex) { | |
android.util.Log.w(mDefaultTag, message, ex); | |
} | |
public void w(Throwable ex) { | |
android.util.Log.w(mDefaultTag, ex.getMessage(), ex); | |
} | |
public void e(String tag, String message) { | |
android.util.Log.e(tag, message); | |
} | |
public void e(String tag, String message, Throwable ex) { | |
android.util.Log.e(tag, message, ex); | |
} | |
public void e(String message) { | |
android.util.Log.e(mDefaultTag, message); | |
} | |
public void e(String message, Throwable ex) { | |
android.util.Log.e(mDefaultTag, message, ex); | |
} | |
public void e(Throwable ex) { | |
android.util.Log.e(mDefaultTag, ex.getMessage(), ex); | |
} | |
} |
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 interface Log { | |
void v(String tag, String message); | |
void v(String message); | |
void d(String tag, String message); | |
void d(String message); | |
void w(String tag, String message); | |
void w(String tag, String message, Throwable ex); | |
void w(String message); | |
void w(String message, Throwable ex); | |
void w(Throwable ex); | |
void e(String tag, String message); | |
void e(String tag, String message, Throwable ex); | |
void e(String message); | |
void e(String message, Throwable ex); | |
void e(Throwable ex); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment