TelemetryTypeHandler

fun interface TelemetryTypeHandler<T : Any>(source)

Knows how to publish values of a type that can't publish themselves, such as one from a library.

It is to TelemetryLoggable what Comparator<T> is to Comparable<T>: TelemetryLoggable is implemented by the type, and a handler is supplied from outside for a type you don't own. Register one with TelemetryTypeHandlers.register, and TelemetryTable.log uses it for values of that type.

Telemetry.registry.handlers.register<Color> { table, name, color ->
table.log(name, color.toHexString())
}

Functions

Link copied to clipboard
abstract fun log(table: TelemetryTable, name: String, value: T)

Logs value under name in table.