logs

fun logs(block: Runnable)

Executes a block of code, capturing all logs generated within the block.

This method clears the current list of captured logs, runs the provided block, and then logs all captured key-value pairs at once. Useful for grouping related log entries together for batch processing.

Parameters

block

The block of code whose logs should be captured and processed.


fun logs(vararg logs: Log)

Logs multiple values with their respective keys based on the type of each value.

Parameters

logs

Vararg parameter of pairs where the first element is the key and the second element is the value to log.


inline fun <A, B> A.logs(key: String?, value: B)

Logs a value of generic type B with a specified key if the system is in test mode, unless the class name of A matches any entry in IGNORED_FILES.

Parameters

key

The key associated with the value to log.

value

The value to log, of generic type B.

If the value is of type Double, Int, Boolean, String, or WPISerializable, it is logged directly. Otherwise, the value is converted to a String before logging. Logging is skipped if the class name of A contains any ignored file name.


fun logs(key: String?, value: Double)

Logs a Double value with a specified key if the system is in test mode.

Parameters

key

The key associated with the value to log.

value

The Double value to log.


fun logs(key: String?, value: Int)

Logs an Int value with a specified key if the system is in test mode.

Parameters

key

The key associated with the value to log.

value

The Int value to log.


fun logs(key: String?, value: Boolean)

Logs a Boolean value with a specified key if the system is in test mode.

Parameters

key

The key associated with the value to log.

value

The Boolean value to log.


fun logs(key: String?, value: String?)

Logs a String value with a specified key if the system is in test mode.

Parameters

key

The key associated with the value to log.

value

The String value to log.


fun <T : WPISerializable?> logs(key: String?, value: T)

Logs a WPISerializable value with a specified key if the system is in test mode.

Parameters

key

The key associated with the value to log.

value

The WPISerializable value to log.


fun <T : StructSerializable?> logs(key: String?, vararg value: T)

Logs a StructSerializable value with a specified key if the system is in test mode.

Parameters

key

The key associated with the value to log.

value

The StructSerializable value to log.