summaryrefslogtreecommitdiffstats
path: root/common/eurephia_log.h
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-09-24 00:56:56 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-09-24 00:56:56 +0200
commitf2a4f0412bc1f7b9069ecbcce8f5599f46f757e0 (patch)
tree4433480af957dbc48a805cc1d94ad897d11c7395 /common/eurephia_log.h
parent1a64e64694faba6783b1d05a193019f1ec241645 (diff)
downloadeurephia-f2a4f0412bc1f7b9069ecbcce8f5599f46f757e0.tar.gz
eurephia-f2a4f0412bc1f7b9069ecbcce8f5599f46f757e0.tar.xz
eurephia-f2a4f0412bc1f7b9069ecbcce8f5599f46f757e0.zip
Improved file logging, providing source file and line number info
Also changed malloc_nullsafe() and free_nullsafe() to report directly which file:line which called the malloc/free function.
Diffstat (limited to 'common/eurephia_log.h')
-rw-r--r--common/eurephia_log.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/eurephia_log.h b/common/eurephia_log.h
index cb83f61..07aaea3 100644
--- a/common/eurephia_log.h
+++ b/common/eurephia_log.h
@@ -41,7 +41,7 @@
* binary if debug logging is not enabled at compile time. This will always use the LOG_DEBUG target
* when calling eurephia_log().
*/
-#define DEBUG(ctx, log_level, log_string...) eurephia_log(ctx, LOG_DEBUG, log_level, ## log_string);
+#define DEBUG(ctx, log_level, log_string...) _eurephia_log_func(ctx, LOG_DEBUG, log_level, __FILE__, __LINE__, ## log_string);
#else
#define DEBUG(ctx, lvl, rest...) {};
#endif
@@ -56,6 +56,8 @@
int eurephia_log_init(eurephiaCTX *ctx, const char *dest, int loglvl);
void eurephia_log_close(eurephiaCTX *ctx);
-void eurephia_log(eurephiaCTX *ctx, int logdst, int loglvl, const char *fmt, ... );
+#define eurephia_log(ctx, dst, lvl, log_string...) _eurephia_log_func(ctx, dst, lvl, __FILE__, __LINE__, ## log_string)
+void _eurephia_log_func(eurephiaCTX *ctx, int logdst, int loglvl, const char *file, int line,
+ const char *fmt, ... );
#endif /* !EUREPHIA_LOG_H_ */