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

Promote LogAssert to function


#1

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;

Regards
Ing Giuseppe ‘Geppo’ Monteleone


#2

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?


#3

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
:slight_smile:

Regards
Ing Giuseppe ‘Geppo’ Monteleone.


#4

Same opinion here :slight_smile: