Android專用的LogCat工具:KLog
這是一個Android專用的LogCat工具,主要功能為打印行號、函數調用、Json解析、點擊跳轉等。靈感來自Logger 。
KLog的特點
- 支持顯示行號
- 支持顯示Log所在函數名稱
- 支持無Tag打印
- 支持點擊函數名稱,跳轉至執行文件位置
- 支持JSON字符串解析打印
- 依賴庫非常小,核心代碼200行,只有4K
使用詳解
下面以KLog.d()為例,下面的用法同樣適用于
- KLog.v()
- KLog.d()
- KLog.i()
- KLog.w()
- KLog.e()
- KLog.a()
Sample Usage
KLog.d()
Use this method , you can get a log like follwing,default tag is current class name
KLog.d(String)
you can print a String with this method ,default tag is current class name
KLog.d(Tag,String)
you can set tag by youself , the result is as bollow
KLog.json(String)
you can print a String with json format ,and it will be formated as following
KLog.json(Tag,String)
as same as above , but with a tag whitch are set by yourself
JCenter
dependencies {
compile 'com.github.zhaokaiqiang.klog:library:0.0.1'
} 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!
