android log工具类
2015-12-15 17:25
399 查看
有时候我们调试程序的时候,会碰到一些问题。这时,我们可能会用到log来把某些信息打印出来。以下就是一个封装的log工具类,
}
package com.dsw.androidutils; import android.util.Log; /** * Log日志工具类 * @author Administrator * */ public class LogUtil { private LogUtil(){}; /** * 打印information日志 * @param tag * 标签 * @param msg * 日志信息 */ public static void i(String tag,String msg){ Log.i(tag, msg); } /** * 打印information日志 * @param tag 标签 * @param msg 日志信息 * @param throwable 异常 */ public static void i(String tag, String msg, Throwable throwable){ Log.i(tag,msg,throwable); } /** * 打印verbose日志 * @param tag 标签 * @param msg 日志信息 */ public static void v(String tag, String msg){ Log.v(tag, msg); } /** * 打印verbose日志 * @param tag 标签 * @param msg 日志信息 * @param throwable 异常 */ public static void v(String tag, String msg, Throwable throwable){ Log.v(tag, msg, throwable); } /** * 打印debug信息 * @param tag 标签信息 * @param msg 日志信息 */ public static void d(String tag, String msg){ Log.d(tag, msg); } /** * 打印debug日志 * @param tag 标签信息 * @param msg 日志信息 * @param throwable 异常 */ public static void d(String tag, String msg, Throwable throwable){ Log.d(tag, msg, throwable); } /** * 打印warn日志 * @param tag 标签信息 * @param msg 日志信息 */ public static void w(String tag, String msg){ Log.w(tag, msg); } /** * 打印warn日志 * @param tag 标签信息 * @param msg 日志信息 * @param throwable 异常 */ public static void w(String tag, String msg, Throwable throwable){ Log.w(tag, msg, throwable); } /** * 打印error日志 * @param tag 标签 * @param msg 日志信息 */ public static void e(String tag, String msg){ Log.e(tag, msg); } /** * 打印error日志 * @param tag 标签 * @param msg 日志信息 * @param throwable 异常 */ public static void e(String tag, String msg, Throwable throwable){ Log.e(tag, msg, throwable); }
}
相关文章推荐
- 使用C++实现JNI接口需要注意的事项
- Android IPC进程间通讯机制
- Android Manifest 用法
- [转载]Activity中ConfigChanges属性的用法
- Android之获取手机上的图片和视频缩略图thumbnails
- Android之使用Http协议实现文件上传功能
- Android学习笔记(二九):嵌入浏览器
- android string.xml文件中的整型和string型代替
- i-jetty环境搭配与编译
- android之定时器AlarmManager
- android wifi 无线调试
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- android 代码实现控件之间的间距
- android FragmentPagerAdapter的“标准”配置
- Android"解决"onTouch和onClick的冲突问题
- android:installLocation简析
- android searchView的关闭事件
- SourceProvider.getJniDirectories