summaryrefslogtreecommitdiffstats
path: root/base/logging.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/logging.h')
-rw-r--r--base/logging.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/base/logging.h b/base/logging.h
index 95cbfac..5fa5681 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -513,6 +513,14 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
#define NOTIMPLEMENTED_POLICY 4
#endif
+#if defined(COMPILER_GCC)
+// On Linux, with GCC, we can use __PRETTY_FUNCTION__ to get the demangled name
+// of the current function in the NOTIMPLEMENTED message.
+#define NOTIMPLEMENTED_MSG "Not implemented reached in " << __PRETTY_FUNCTION__
+#else
+#define NOTIMPLEMENTED_MSG "NOT IMPLEMENTED"
+#endif
+
#if NOTIMPLEMENTED_POLICY == 0
#define NOTIMPLEMENTED() ;
#elif NOTIMPLEMENTED_POLICY == 1
@@ -523,11 +531,11 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
#elif NOTIMPLEMENTED_POLICY == 3
#define NOTIMPLEMENTED() NOTREACHED()
#elif NOTIMPLEMENTED_POLICY == 4
-#define NOTIMPLEMENTED() LOG(ERROR) << "NOT IMPLEMENTED!"
+#define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG
#elif NOTIMPLEMENTED_POLICY == 5
#define NOTIMPLEMENTED() do {\
static int count = 0;\
- LOG_IF(ERROR, 0 == count++) << "NOT IMPLEMENTED!";\
+ LOG_IF(ERROR, 0 == count++) << NOTIMPLEMENTED_MSG;\
} while(0)
#endif