日志工具类
2015-10-12 15:55
288 查看
/* * @(#)LogAuto.java Project:androidkit * Date:2013-9-9 * * Copyright (c) 2013 CFuture09, Institute of Software, * Guangdong Ocean University, Zhanjiang, GuangDong, China. * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.lurencun.cfuture09.androidkit.utils.lang; import android.util.Log; import com.githang.androidkit.Version; /** * @author Geek_Soledad <a target="_blank" href= * "http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=XTAuOSVzPDM5LzI0OR0sLHM_MjA" * style="text-decoration:none;"><img src= * "http://rescdn.qqmail.com/zh_CN/htmledition/images/function/qm_open/ico_mailme_01.png" * /></a> */ public class LogAuto { public static final int ASSERT = Log.ASSERT; public static final int DEBUG = Log.DEBUG; public static final int ERROR = Log.ERROR; public static final int INFO = Log.INFO; public static final int VERBOSE = Log.VERBOSE; public static final int WARN = Log.WARN; protected final String TAG; protected LogAuto(Class<?> clazz) { TAG = initTag(clazz); } protected String initTag(Class<?> clazz) { return String.format("%s: %s", Version.ANDROIDKIT_NAME, clazz.getSimpleName()); } public static LogAuto getLog(Class<?> clazz) { return new LogAuto(clazz); } public void d(String msg) { Log.d(TAG, msg); } public void d(String msg, Throwable tr) { Log.d(TAG, msg, tr); } public void e(String msg) { Log.e(TAG, msg); } public void e(String msg, Throwable tr) { Log.e(TAG, msg, tr); } public void i(String msg) { Log.i(TAG, msg); } public void i(String msg, Throwable tr) { Log.i(TAG, msg, tr); } public void v(String msg) { Log.v(TAG, msg); } public void v(String msg, Throwable tr) { Log.v(TAG, msg, tr); } public void w(String msg) { Log.w(TAG, msg); } public void w(Throwable tr) { Log.w(TAG, tr); } public void w(String msg, Throwable tr) { Log.w(TAG, msg, tr); } public void getStackTraceString(Throwable tr) { Log.getStackTraceString(tr); } public void isLoggable(int level) { Log.isLoggable(TAG, level); } public void println(int priority, String msg) { Log.println(priority, TAG, msg); } }
相关文章推荐
- Hdu 5496 Beauty of Sequence (组合数)
- Android Animation学习笔记
- 移动APP如何摆脱“叫好不叫座”的局面
- 韩顺平 java 第36讲 事件监听
- cxf发布webservice
- jquery validate 修改错误信息的显示位置
- 解读ASP.NET 5 & MVC6系列(3):项目发布与部署
- java变量初始化
- Google搜索的几个使用技巧——让你的搜索结果更准确
- ASP.NET中的Request和Respone对象的使用
- MySQL 入门教程
- MySQL 入门教程
- MySQL 入门教程
- zoj 3911 Prime Query (ZOJ Monthly, October 2015 - I)
- Java 反射
- deeplearning系列(五)实现一个简单的深度神经网络
- 写个小demo巩固基础 gridview自己玩
- 文件/目录操作(3)——cat、tac、more、head、tail、od命令
- jstat详解
- long 类型的自增长ID生成类,支持多线程。