|
|
@ -1,23 +0,0 @@ |
|
|
|
--- a/src/logging.h
|
|
|
|
+++ b/src/logging.h
|
|
|
|
@@ -36,6 +36,20 @@ enum _LogSeverity {
|
|
|
|
LOG_MAX |
|
|
|
}; |
|
|
|
|
|
|
|
+#define STRIPPATH(s)\
|
|
|
|
+ (sizeof(s) > 2 && (s)[sizeof(s)-2] == '/' ? (s) + sizeof(s) - 1 : \
|
|
|
|
+ sizeof(s) > 3 && (s)[sizeof(s)-3] == '/' ? (s) + sizeof(s) - 2 : \
|
|
|
|
+ sizeof(s) > 4 && (s)[sizeof(s)-4] == '/' ? (s) + sizeof(s) - 3 : \
|
|
|
|
+ sizeof(s) > 5 && (s)[sizeof(s)-5] == '/' ? (s) + sizeof(s) - 4 : \
|
|
|
|
+ sizeof(s) > 6 && (s)[sizeof(s)-6] == '/' ? (s) + sizeof(s) - 5 : \
|
|
|
|
+ sizeof(s) > 7 && (s)[sizeof(s)-7] == '/' ? (s) + sizeof(s) - 6 : \
|
|
|
|
+ sizeof(s) > 8 && (s)[sizeof(s)-8] == '/' ? (s) + sizeof(s) - 7 : \
|
|
|
|
+ sizeof(s) > 9 && (s)[sizeof(s)-9] == '/' ? (s) + sizeof(s) - 8 : \
|
|
|
|
+ sizeof(s) > 10 && (s)[sizeof(s)-10] == '/' ? (s) + sizeof(s) - 9 : \
|
|
|
|
+ sizeof(s) > 11 && (s)[sizeof(s)-11] == '/' ? (s) + sizeof(s) - 10 : (s))
|
|
|
|
+
|
|
|
|
+#define __FILENAME__ STRIPPATH(__FILE__)
|
|
|
|
+
|
|
|
|
#define DLOG(...) _log(__FILENAME__, __LINE__, LOG_DEBUG, __VA_ARGS__) |
|
|
|
#define ILOG(...) _log(__FILENAME__, __LINE__, LOG_INFO, __VA_ARGS__) |
|
|
|
#define WLOG(...) _log(__FILENAME__, __LINE__, LOG_WARNING, __VA_ARGS__) |