Library to implement various levels of messages in cpp files

Dependents:   IoT_Ex BatteryModelTester BatteryModelTester

Committer:
defrost
Date:
Thu Nov 24 16:31:54 2016 +0000
Revision:
0:73f5add64cef
Child:
1:93ad6b489cf7
- initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
defrost 0:73f5add64cef 1 // **************
defrost 0:73f5add64cef 2 // * messages.h *
defrost 0:73f5add64cef 3 // **************
defrost 0:73f5add64cef 4 //
defrost 0:73f5add64cef 5 // Created: 2016/06/29
defrost 0:73f5add64cef 6 // By: Damien Frost
defrost 0:73f5add64cef 7 //
defrost 0:73f5add64cef 8 // Description:
defrost 0:73f5add64cef 9 // Used to display different levels of debugging messages to the terminal.
defrost 0:73f5add64cef 10
defrost 0:73f5add64cef 11 #ifndef IQ_MESSAGES_H
defrost 0:73f5add64cef 12 #define IQ_MESSAGES_H
defrost 0:73f5add64cef 13
defrost 0:73f5add64cef 14 #ifdef DEBUG
defrost 0:73f5add64cef 15 #define DBG(x, ...) printf("["FUNCNAME" : DBG] "x" <line %d>\r\n", ##__VA_ARGS__,__LINE__);
defrost 0:73f5add64cef 16 #else
defrost 0:73f5add64cef 17 #define DBG(x, ...)
defrost 0:73f5add64cef 18 #endif
defrost 0:73f5add64cef 19
defrost 0:73f5add64cef 20 #ifdef ERRMESSAGES
defrost 0:73f5add64cef 21 #define ERR(x, ...) printf("["FUNCNAME" : ERR] "x"\r\n", ##__VA_ARGS__);
defrost 0:73f5add64cef 22 #else
defrost 0:73f5add64cef 23 #define ERR(x, ...)
defrost 0:73f5add64cef 24 #endif
defrost 0:73f5add64cef 25
defrost 0:73f5add64cef 26 #ifdef WARNMESSAGES
defrost 0:73f5add64cef 27 #define WARN(x, ...) printf("["FUNCNAME" : WARN] "x"\r\n", ##__VA_ARGS__);
defrost 0:73f5add64cef 28 #else
defrost 0:73f5add64cef 29 #define WARN(x, ...)
defrost 0:73f5add64cef 30 #endif
defrost 0:73f5add64cef 31
defrost 0:73f5add64cef 32 #ifdef INFOMESSAGES
defrost 0:73f5add64cef 33 #define INFO(x, ...) printf("["FUNCNAME" : INFO] "x"\r\n", ##__VA_ARGS__);
defrost 0:73f5add64cef 34 #else
defrost 0:73f5add64cef 35 #define INFO(x, ...)
defrost 0:73f5add64cef 36 #endif
defrost 0:73f5add64cef 37
defrost 0:73f5add64cef 38 #endif /* IQ_MESSAGES_H */