Category

interface Category

A typed label identifying the layer or component that produced a log entry.

Consumers are expected to declare their own enum implementing this interface, for example:

enum class TransportLayer : Category {
HCI, L2CAP, GATT, APPLICATION,
}

This property is satisfied automatically by Kotlin enum, so no extra boilerplate is required on the consumer side.

It is also possible to implement using a value class or object:

@JvmInline
value class TransportLayer(override val name: String) : Category

object Layer : Category {
val HCI = TransportLayer("HCI")
val L2CAP = TransportLayer("L2CAP")
val GATT = TransportLayer("GATT")
val APP = TransportLayer("APPLICATION")
}

Properties

Link copied to clipboard
abstract val name: String

The property name.