]> pilppa.org Git - libplp.git/blobdiff - src/log.h
updates to log_debug/info/warning/error functions
[libplp.git] / src / log.h
index 17596df25c93a206fd27da21f8063804d1267219..c88b6c8bc4dde2ce3f0ebdcd779a51c4a12b4cb9 100644 (file)
--- a/src/log.h
+++ b/src/log.h
@@ -10,9 +10,9 @@
 
 #include <stdio.h>
 
-#define log_debug(...)   fprintf(stdout, __VA_ARGS__)
-#define log_info(...)   fprintf(stdout, __VA_ARGS__)
-#define log_warning(...)   fprintf(stderr, __VA_ARGS__)
-#define log_error(...)   fprintf(stderr, __VA_ARGS__)
+#define log_debug(a, b...) fprintf(stdout, "[dbg] %s: " a, __FUNCTION__, ## b)
+#define log_info(a, b...) fprintf(stdout, "[inf] %s: " a, __FUNCTION__, ## b)
+#define log_warning(a, b...) fprintf(stderr, "[wrn] %s: " a, __FUNCTION__, ## b)
+#define log_error(a, b...) fprintf(stderr, "[err] %s: " a, __FUNCTION__, ## b)
 
 #endif /* LOG_H_ */