logIf

inline fun <API : LoggingApi<API>> LoggingApi<API>.logIf(condition: () -> Boolean, logOperation: LoggingApi<API>.() -> Unit)

Executes the provided logging operation if the specified condition evaluates to true.

This function allows for conditional logging using a specified LoggingApi. The logging operation will only be performed if the condition lambda returns true.

Parameters

condition

A lambda that provides a condition to evaluate. The logging operation will be executed only if this condition returns true.

logOperation

The logging operation to perform if the condition is satisfied. This is an extension function on the logging API.