David's final changes: more profiler features, fixes.
[ipdf/code.git] / src / log.h
index 0dfedfd..8a5882c 100644 (file)
--- a/src/log.h
+++ b/src/log.h
@@ -9,6 +9,7 @@
 #include <cstdio>
 #include <cstdlib>
 #include <string>
+#include <cstring> // for strerror etc
 
 inline std::string methodName(const std::string& prettyFunction)
 {
@@ -35,11 +36,12 @@ inline std::string methodName(const std::string& prettyFunction)
 
 #define Debug(...) LogEx(LOG_DEBUG, __func__, __FILE__, __LINE__, __VA_ARGS__)
 #define Error(...) LogEx(LOG_ERR, __func__, __FILE__, __LINE__, __VA_ARGS__)
-#define Warn(...) LogEx(LOG_WARN, __func__, __FILE__, __LINE__, __VA_ARGS__)
+#define Warn(...) LogEx(LOG_WARNING, __func__, __FILE__, __LINE__, __VA_ARGS__)
+extern void Backtrace(int size=10);
 
 
 extern void LogEx(int level, const char * funct, const char * file, int line,  ...); // General function for printing log messages to stderr
-extern void FatalEx(const char * funct, const char * file, int line, ...); // Function that deals with a fatal error (prints a message, then exits the program).
+extern void FatalEx(const char * funct, const char * file, int line, ...) __attribute__((__noreturn__)); // Function that deals with a fatal error (prints a message, then exits the program).
 
 #endif //_LOG_H
 

UCC git Repository :: git.ucc.asn.au