Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

Promote LogAssert to function


Hi Guys,

I think that cold be usefull to have LogAssert as funtion and not as a procedure.
It should simply return value of condition

so i could write

if not SiMain.LogAssert(VarInstance <> nil,'ERROR: VarInsanceNil') then Exit;

Ing Giuseppe ‘Geppo’ Monteleone


Hello Giuseppe,

I’m not sure if mixing logging and application logic is optimal. For example, what should this function return if logging is disabled?


Hi Tobias,

Ok you’re right, sometime is better replicate code… :slight_smile: a lot of books says about SRP (single responsability principle)…

logging is a thing, application logic is another thing… but I didn’t think about this

Ing Giuseppe ‘Geppo’ Monteleone.


Same opinion here :slight_smile: