Enable crash report tool in debugging sample application
This commit is contained in:
parent
c369464776
commit
ea5a53ddc4
1 changed files with 14 additions and 13 deletions
|
@ -18,11 +18,9 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
// contains all debug features
|
// contains all debug features
|
||||||
#include "nel/misc/debug.h"
|
#include <nel/misc/debug.h>
|
||||||
|
|
||||||
using namespace NLMISC;
|
int main(int /* argc */, char ** /* argv */)
|
||||||
|
|
||||||
int main (int /* argc */, char ** /* argv */)
|
|
||||||
{
|
{
|
||||||
// all debug functions have different behaviors in debug and in release mode.
|
// all debug functions have different behaviors in debug and in release mode.
|
||||||
// in general, in debug mode, all debug functions are active, they display
|
// in general, in debug mode, all debug functions are active, they display
|
||||||
|
@ -36,20 +34,23 @@ int main (int /* argc */, char ** /* argv */)
|
||||||
// in release mode, this function does nothing by default. you have to add a displayer
|
// in release mode, this function does nothing by default. you have to add a displayer
|
||||||
// manually, or put true in the parameter to say to the function that you want it to
|
// manually, or put true in the parameter to say to the function that you want it to
|
||||||
// add the default displayers
|
// add the default displayers
|
||||||
createDebug ();
|
NLMISC::createDebug();
|
||||||
|
|
||||||
|
// enable the crash report tool
|
||||||
|
NLMISC::INelContext::getInstance().setWindowedApplication(true);
|
||||||
|
|
||||||
// display debug information, that will be skipped in release mode.
|
// display debug information, that will be skipped in release mode.
|
||||||
nldebug ("nldebug() %d", 1);
|
nldebug("nldebug() %d", 1);
|
||||||
|
|
||||||
// display the string
|
// display the string
|
||||||
nlinfo ("nlinfo() %d", 2);
|
nlinfo("nlinfo() %d", 2);
|
||||||
|
|
||||||
// when something not normal, but that the program can manage, occurs, call nlwarning()
|
// when something not normal, but that the program can manage, occurs, call nlwarning()
|
||||||
nlwarning ("nlwarning() %d", 3);
|
nlwarning("nlwarning() %d", 3);
|
||||||
|
|
||||||
// nlassert() is like assert but do more powerful things. in release mode, the test is
|
// nlassert() is like assert but do more powerful things. in release mode, the test is
|
||||||
// not executed and nothing will happen. (Press F5 in Visual C++ to continue the execution)
|
// not executed and nothing will happen. (Press F5 in Visual C++ to continue the execution)
|
||||||
nlassert (true == false);
|
nlassert(true == false);
|
||||||
|
|
||||||
// in a switch case or when you want that the program never executes a part of code, use stop.
|
// in a switch case or when you want that the program never executes a part of code, use stop.
|
||||||
// in release, nlstop does nothing. in debug mode,
|
// in release, nlstop does nothing. in debug mode,
|
||||||
|
@ -61,16 +62,16 @@ int main (int /* argc */, char ** /* argv */)
|
||||||
// occurs. (In Visual C++ press F5 to continue)
|
// occurs. (In Visual C++ press F5 to continue)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
nlerror ("nlerror() %d", 4);
|
nlerror("nlerror() %d", 4);
|
||||||
}
|
}
|
||||||
catch(const EFatalError &)
|
catch (const NLMISC::EFatalError &)
|
||||||
{
|
{
|
||||||
// just continue...
|
// just continue...
|
||||||
nlinfo ("nlerror() generated an EFatalError exception, just ignore it");
|
nlinfo("nlerror() generated an EFatalError exception, just ignore it");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\nPress <return> to exit\n");
|
printf("\nPress <return> to exit\n");
|
||||||
getchar ();
|
getchar();
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue