-
- @section overview_debugging_logging Logging functions
-
- You can use the #wxLogDebug and #wxLogTrace functions to output debugging information in
- debug mode; it will do nothing for non-debugging code.
-
-
-
- @section overview_debugging_dbgctx2 wxDebugContext overview
-
- Class: wxDebugContext
-
- wxDebugContext is a class for performing various debugging and memory tracing operations.
-
- This class has only static data and function members, and there should be
- no instances. Probably the most useful members are SetFile (for directing output
- to a file, instead of the default standard error or debugger output);
- Dump (for dumping the dynamically allocated objects) and PrintStatistics
- (for dumping information about allocation of objects). You can also call
- Check to check memory blocks for integrity.
-
- Here's an example of use. The SetCheckpoint ensures that only the
- allocations done after the checkpoint will be dumped.
-
- @code
- wxDebugContext::SetCheckpoint();
-
- wxDebugContext::SetFile("c:\\temp\\debug.log");
-
- wxString *thing = new wxString;
-
- char *ordinaryNonObject = new char[1000];
-
- wxDebugContext::Dump();
- wxDebugContext::PrintStatistics();
- @endcode
-
- You can use wxDebugContext if __WXDEBUG__ is defined, or you can use it
- at any other time (if wxUSE_DEBUG_CONTEXT is set to 1 in setup.h). It is not disabled
- in non-debug mode because you may not wish to recompile wxWidgets and your entire application
- just to make use of the error logging facility.
-
- @note wxDebugContext::SetFile has a problem at present, so use the default stream instead.
- Eventually the logging will be done through the wxLog facilities instead.