AndroidLogcatLogger

class AndroidLogcatLogger(minPriority: LogPriority = LogPriority.DEBUG) : LogcatLogger

A logcat logger that delegates to android.util.Log for any log with a priority of at least minPriorityInt, and is otherwise a no-op.

Handles special cases for LogPriority.ASSERT (which requires sending to Log.wtf) and splitting logs to be at most 4000 characters per line (otherwise logcat just truncates).

Call installOnDebuggableApp to make sure you never log in release builds.

The implementation is based on Timber DebugTree.

Constructors

Link copied to clipboard
constructor(minPriority: LogPriority = LogPriority.DEBUG)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun isLoggable(priority: LogPriority): Boolean

Whether a log with the provided priority should be logged and the corresponding message providing lambda evaluated. Called by logcat.

Link copied to clipboard
open override fun log(priority: LogPriority, tag: String, message: String)

Write a log to its destination. Called by logcat.