Debug.Log Extensions
Documentation (1.1.9)

◆ Ensure() [2/2]

static bool Sisus.Debugging.Critical.Ensure ( bool  condition,
int  channel,
Object  context = null 

Logs an error message to the Console if condition is not true and returns true if condition was true or false if it was not.

float Divide(float dividend, float divisor) { return Critical.Ensure(divisor != 0f) ? dividend / divisor : 0f; }

conditionCondition you expect to be true.
channelThe channel to which the message belongs if logged.
contextObject to which the assertion applies.
true if condition was true; otherwise, false.