:: Re: [DNG] Error handling alternativ…
Inizio della pagina
Delete this message
Reply to this message
Autore: karl
Data:  
To: dng
Oggetto: Re: [DNG] Error handling alternatives (was Re: another programming language question)
Karl:
...

this code:
LOG_VIF( cnti != cnto, LOG_ERR, " cnti = %ld, cnto = %ld", cnti, cnto ) { return -1; }
gives this:
> 2024-10-16_21:33:53: ERR run.c 62: <cnti != cnto> cnti = 0, cnto = 3

...

when the test failed. I.e. I can see a copy of the actual test:
"cnti != cnto" in the log. I get that by including a copy of
the test "f" text in the printout:

#define LOG_VIF( f, lvl, format, ... ) \
if ( (f) && ( LOG_PRINTF(lvl, "<%s>" format, #f, __VA_ARGS__), 1 ) )

Can I get that in ADA too ?

I think it is nice to see the actual test that triggered the log line
in the log.

Regards,
/Karl Hammar