1

Topic: 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;

Regards
Ing Giuseppe 'Geppo' Monteleone

2

Re: Promote LogAssert to function

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

Re: Promote LogAssert to function

Hi Tobias,

Ok you're right, sometime is better replicate code.... :-) 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
:-)

Regards
Ing Giuseppe 'Geppo' Monteleone.

4

Re: Promote LogAssert to function

Same opinion here smile