Library to implement various levels of messages in cpp files

Dependents:   IoT_Ex BatteryModelTester BatteryModelTester

Revision:
6:fef815be8d4f
Parent:
5:34f9e8994d54
Child:
7:d78684eca79d
diff -r 34f9e8994d54 -r fef815be8d4f messages.h
--- a/messages.h	Wed Jan 18 21:38:34 2017 +0000
+++ b/messages.h	Fri Jan 20 10:45:05 2017 +0000
@@ -59,25 +59,25 @@
 #define MESSAGES_H
 
 #ifdef DEBUG
-#define DBG(x, ...) printf("["FUNCNAME" : DBG] "x" <line %d>\r\n", ##__VA_ARGS__,__LINE__);
+#define DBG(serPort, x, ...) serPort->printf("["FUNCNAME" : DBG] "x" <line %d>\r\n", ##__VA_ARGS__,__LINE__);
 #else
 #define DBG(x, ...)
 #endif
 
 #ifdef ERRMESSAGES
-#define ERR(x, ...) printf("["FUNCNAME" : ERR] "x"\r\n", ##__VA_ARGS__);
+#define ERR(serPort, x, ...) serPort->printf("["FUNCNAME" : ERR] "x"\r\n", ##__VA_ARGS__);
 #else
 #define ERR(x, ...)
 #endif
 
 #ifdef WARNMESSAGES
-#define WARN(x, ...) printf("["FUNCNAME" : WARN] "x"\r\n", ##__VA_ARGS__);
+#define WARN(serPort, x, ...) serPort->printf("["FUNCNAME" : WARN] "x"\r\n", ##__VA_ARGS__);
 #else
 #define WARN(x, ...)
 #endif
 
 #ifdef INFOMESSAGES
-#define INFO(x, ...) printf("["FUNCNAME" : INFO] "x"\r\n", ##__VA_ARGS__);
+#define INFO(serPort, x, ...) serPort->printf("["FUNCNAME" : INFO] "x"\r\n", ##__VA_ARGS__);
 #else
 #define INFO(x, ...)
 #endif