Log日誌終極版(帶註解,專案專用)

2021-08-27 18:09:06 字數 2542 閱讀 7458

我沒有解釋太多,因為只要從事android開發有過經驗的人都明白什麼意思,我之所以發出來,是希望有些丟失掉的人可以參考借鑑一下,此篇僅供參考,具體還得看你自己專案的需要了!

public class logger 

public static synchronized void v(string format, object... args) else}}

/*** 級別最低,用於輸出任意對除錯或者開發過程中有幫助的資訊,

** @param format the format string (see )

* @param args the list of arguments passed to the formatter. if there are

* more arguments than required by ,

* additional arguments are ignored.

*/public static synchronized void v(throwable throwable, string format, object... args) else}}

public static synchronized void d(string format, object... args) else}}

/*** 除錯級別, 比verbose高,用於輸出除錯資訊

** @param format the format string (see )

* @param args the list of arguments passed to the formatter. if there are

* more arguments than required by ,

* additional arguments are ignored.

*/public static synchronized void d(throwable throwable, string format, object... args) else}}

/*** 用於輸出比較重要的資訊,系統預設的級別,

** @param format the format string (see )

* @param args the list of arguments passed to the formatter. if there are

* more arguments than required by ,

* additional arguments are ignored.

*/public static void i(string format, object... args)

public static void i(throwable throwable, string format, object... args)

public static void w(string format, object... args)

public static void w(throwable throwable, string format, object... args)

public static void e(string format, object... args)

public static void e(throwable throwable, string format, object... args)

public string formatjson(string json)

private static string get******stacktrace()

public static string getmoredetailstacktrace()

return builder.tostring();

}private static string buildprivatemessage(throwable throwable, string format, object... args) catch (exception e)

if(debug_more_detail_stack_info)

if(throwable != null)

return mmessagebuffer.tostring();

}public static string isnull(object o)

public static string tostringob(object o)

private static boolean isenabledebug()

if(!debug_v)

return true;

}private static void log(int level, string mes)else

}}else

}private static void println(int level,string mes)

}}

excel巨集 終極版

private sub commandbutton1 click sheet1 q20.list sheet2 q20trim.list sheet3 源資料表 副本 新建sheet4 批量合成 刪除空行 變成m 最終資料存於sheet3列pqr 批量合成 dim s as integer s te...

頁面傳參終極版

頁面傳引數是一種比較常見的業務需求,根據實現原理及適用環境可以分為兩大類。在普通瀏覽器端常用的方法有如下幾種 1.利用url傳參 在頁面跳轉的時候通過設定window.location.href新增引數,在接收引數的頁面通過window.location.search獲取引數字串。傳送引數的頁面 w...

kewin 接小球終極版

import pygame import random 1.loading 初始化 pygame.init 2.視窗 dis分開 play玩 展示 screen width 960screen height 540screen pygame.display.set mode screen width...