/**
* rl 2018/07/14
* 自定义一个LogUtils类,用来输出日志信息
*/
public class LogUtils {
private static boolean isDeBug = true;
private static final String TAG="LogUtils";
//Info
public static void i(String str){
if(isDeBug){
Log.i(TAG, str );
}
}
//DeBug
public static void d(String str){
if(isDeBug){
Log.d(TAG, str );
}
}
//error
public static void e(String str){
if(isDeBug){
Log.e(TAG, str );
}
}
//warn
public static void w(String str){
if(isDeBug){
Log.w(TAG, str );
}
}
public static void v(String str){
if(isDeBug){
Log.v(TAG, str );
}
}
//自己传入TAG
//Info
public static void i(String tag,String str){
if(isDeBug){
Log.i(tag, str );
}
}
//DeBug
public static void d(String tag,String str){
if(isDeBug){
Log.d(tag, str );
}
}
//error
public static void e(String tag,String str){
if(isDeBug){
Log.e(tag, str );
}
}
//warn
public static void w(String tag,String str){
if(isDeBug){
Log.w(tag, str );
}
}
public static void v(String tag,String str){
if(isDeBug){
Log.v(tag, str );
}
}
}
日志打印自定义类,可复用的一类
最新推荐文章于 2024-04-13 14:55:52 发布