Yet another pretty logger for android.
implementation 'com.github.7hens:logdog:<last_version>'
Logdog { "hello" }
.error { Throwable() }
.debug
.logMemory(this)
.logCount("hello")
.logCount("hello")
.warn
.logTime("hello")
.logTime("hello")
.requires(!BuildConfig.DEBUG) () { "What a Terrible Failure" }
You can customize a logger as you want.
val customLogger = Logdog
.priority(LogPriority.WARN)
.strategy(LogStrategy.WARN)
.tag("CustomLogger")
.logger { priority, tag, message ->
Logger.logcat().log(priority, tag,
PrettyLogger.getStackInfo() + " " + PrettyLogger.stringOf(message))
}
You can view all logs about Logdog by filtering /=
.
E/=:CustomLogger: MainActivity.onCreate(MainActivity.java:53) hello world
D/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
D/=:Logdog: β MainActivity.testLog(MainActivity.java:59) on thread: main
D/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
D/=:Logdog: β hello
D/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
E/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
E/=:Logdog: β MainActivity.testLog(MainActivity.java:60) on thread: main
E/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
E/=:Logdog: β java.lang.Throwable
E/=:Logdog: β at cn.thens.logdog.sample.MainActivity.testLog(MainActivity.java:59)
E/=:Logdog: β at cn.thens.logdog.sample.MainActivity.onCreate(MainActivity.java:53)
E/=:Logdog: β at android.app.Activity.performCreate(Activity.java:6278)
E/=:Logdog: β at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
E/=:Logdog: β at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2396)
E/=:Logdog: β at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2503)
E/=:Logdog: β at android.app.ActivityThread.-wrap11(ActivityThread.java)
E/=:Logdog: β at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1353)
E/=:Logdog: β at android.os.Handler.dispatchMessage(Handler.java:102)
E/=:Logdog: β at android.os.Looper.loop(Looper.java:148)
E/=:Logdog: β at android.app.ActivityThread.main(ActivityThread.java:5529)
E/=:Logdog: β at java.lang.reflect.Method.invoke(Native Method)
E/=:Logdog: β at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
E/=:Logdog: β at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)
E/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
D/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
D/=:Logdog: β MainActivity.testLog(MainActivity.java:61) on thread: main
D/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
D/=:Logdog: β total memory: 3035 MB
D/=:Logdog: β avail memory: 2617 MB
D/=:Logdog: β threshold: 144 MB
D/=:Logdog: β low memory: false
D/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
D/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
D/=:Logdog: β MainActivity.testLog(MainActivity.java:62) on thread: main
D/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
D/=:Logdog: β count(hello): 1
D/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
D/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
D/=:Logdog: β MainActivity.testLog(MainActivity.java:63) on thread: main
D/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
D/=:Logdog: β count(hello): 2
D/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
W/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
W/=:Logdog: β MainActivity.testLog(MainActivity.java:64) on thread: main
W/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
W/=:Logdog: β time(hello): _
W/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
W/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
W/=:Logdog: β MainActivity.testLog(MainActivity.java:65) on thread: main
W/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
W/=:Logdog: β time(hello): 1ms
W/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
A/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
A/=:Logdog: β MainActivity.testLog(MainActivity.java:66) on thread: main
A/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
A/=:Logdog: β What a Terrible Failure
A/=:Logdog: βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ