Exceptions |
Top Previous Next |
JrDebugLog can be used to easily log any thrown exceptions.
To log exceptions, change (you can also use JrDebugThrow if you prefer the longer version): throw Exception to dbthrow(Exception,char *reason)
When debugging is compiled out, these statements are reduced to the normal throw statements; when debugging is compiled in, the exceptions are thrown as normal after a debug logging event is triggered.
Because some applications make heavy use of exceptions for normal processing, you may want to disable the logging of exceptions by default: JrDebugDisableExceptionLogging();
You can enable it (and specify the severity level to assign to exceptions): JrDebugEnableExceptionLogging(int exceptionlevel=50);
You can combine this with the setting of alarm levels if you want to have a popup notify you when exceptions are triggered.
|