LogcatLogFormatter

open class LogcatLogFormatter(time: Boolean = true) : LogFormatter

A LogFormatter that mimics the Android Logcat output style using println().

Depending on configuration:

  • If time is true, logs are formatted as:

<date> <time> <pid> <level> <domain>: <message>

Example: 10-05 15:30:12.451 1234 D MyApp: A debug message

  • If time is false, logs are formatted as:

<level>/<domain>(<pid>): <message>

Example: D/MyApp(1234): A debug message

Parameters

time

Whether to include timestamps in the log output. Default is true.

Constructors

Link copied to clipboard
constructor(time: Boolean = true)

Functions

Link copied to clipboard
override fun format(level: LogLevel, tag: String, message: String): String
Link copied to clipboard
open override fun formatLevel(level: LogLevel): String
Link copied to clipboard
open override fun formatMessage(message: String): String
Link copied to clipboard
open override fun formatTag(tag: String): String
Link copied to clipboard
fun LogFormatter.withColor(colorMap: ColorMap = ColorMap()): LogFormatter