Fate

object Fate

The entry point for logging: a shared FateRegistry and its root table.

Fate.log("batteryVoltage", hardwareMap.voltageSensor.iterator().next().voltage)

val drive = Fate.table("Drive")
drive.log("leftVelocity", left.velocity)
drive.log("pose", follower.pose)

Values go to the backends registered on registry. On a robot, FateLogManager registers one for each OpMode. In a unit test, register a MockFateBackend and read back what was logged.

Everything here forwards to the root table. See FateTable for how values are typed, what a path holds, and what thread safety to expect.

Properties

Link copied to clipboard

The registry this facade logs through.

Link copied to clipboard

The root table, which every other table is under.

Functions

Link copied to clipboard
fun <T : Any> log(name: String, value: T, schema: FateSchema<T>)

Logs value at name using schema instead of inferring one.

Link copied to clipboard
inline fun <T : Any> Fate.log(name: String, value: T)

Logs value at name under the root table, inferring its schema from T's static type, type arguments included.

Link copied to clipboard
@JvmName(name = "log")
fun logErased(name: String, value: Any)

Logs value at name, inferring its schema from its runtime class.

Link copied to clipboard
fun logTyped(name: String, value: Any, type: KType)

Logs value at name, inferring its schema from the fully resolved type.

Link copied to clipboard

Returns the table name, creating it if needed. Hold on to it instead of looking it up every loop.