Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactor CPPLOG_FATAL_NOEXIT to CPPLOG_FATAL_EXIT

  • Loading branch information...
commit 52c6ec8177b0eb2821521dd4dcc235f638184598 1 parent e095e84
@z00m1n z00m1n authored
Showing with 9 additions and 5 deletions.
  1. +5 −5 cpplog.hpp
  2. +4 −0 main.cpp
View
10 cpplog.hpp
@@ -28,8 +28,8 @@
// #define CPPLOG_HELPER_MACROS
// Enables inclusion of the CHECK_* macros.
//
-// #define CPPLOG_FATAL_NOEXIT
-// Causes a fatal error to not exit() the process.
+// #define CPPLOG_FATAL_EXIT
+// Causes a fatal error to exit() the process.
//
// #define CPPLOG_FATAL_EXIT_DEBUG
// Causes a fatal error to exit() the process if in debug mode.
@@ -60,7 +60,7 @@
//#define CPPLOG_SYSTEM_IDS
//#define CPPLOG_THREADING
//#define CPPLOG_HELPER_MACROS
-//#define CPPLOG_FATAL_NOEXIT
+//#define CPPLOG_FATAL_EXIT
//#define CPPLOG_FATAL_EXIT_DEBUG
@@ -342,11 +342,11 @@ namespace cpplog
#ifdef _DEBUG
// Only exit in debug mode if CPPLOG_FATAL_EXIT_DEBUG is set.
-#ifdef(CPPLOG_FATAL_EXIT_DEBUG) && !defined(CPPLOG_FATAL_NOEXIT)
+#if defined(CPPLOG_FATAL_EXIT_DEBUG CPPLOG_FATAL_EXIT)
::exit(1);
#endif
#else //!_DEBUG
-#ifdef(CPPLOG_FATAL_EXIT_DEBUG)
+#ifdef CPPLOG_FATAL_EXIT_DEBUG
::exit(1)
#endif
#endif
View
4 main.cpp
@@ -196,6 +196,7 @@ int TestConditionMacros()
return failed;
}
+#ifdef CPPLOG_HELPER_MACROS
int TestCheckMacros()
{
int failed = 0;
@@ -268,6 +269,7 @@ int TestCheckMacros()
cout << "done!" << endl;
return failed;
}
+#endif
int TestTeeLogger()
{
@@ -517,7 +519,9 @@ int TestLogging()
totalFailures += TestLogLevels();
totalFailures += TestDebugLogLevels();
totalFailures += TestConditionMacros();
+#ifdef CPPLOG_HELPER_MACROS
totalFailures += TestCheckMacros();
+#endif
totalFailures += TestTeeLogger();
totalFailures += TestRotatingLoggers();
totalFailures += TestOtherLogging();
Please sign in to comment.
Something went wrong with that request. Please try again.