Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed SocketModem nanoservice_client_1_12
debug.h@9:5b116d75f41a, 2014-02-18 (annotated)
- Committer:
- zdshelby
- Date:
- Tue Feb 18 04:56:33 2014 +0000
- Revision:
- 9:5b116d75f41a
- Parent:
- 0:f739ace74102
- CoAP/TCP read routine now working reliably; - Improved debugging
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| zdshelby | 0:f739ace74102 | 1 | #ifndef DEBUG_H | 
| zdshelby | 0:f739ace74102 | 2 | #define DEBUG_H | 
| zdshelby | 0:f739ace74102 | 3 | |
| zdshelby | 0:f739ace74102 | 4 | #include "mbed.h" | 
| zdshelby | 0:f739ace74102 | 5 | |
| zdshelby | 0:f739ace74102 | 6 | // Set the debugging level, 0 = off, 1 = simple, 2 = detailed | 
| zdshelby | 0:f739ace74102 | 7 | #define DEBUG_LEVEL 1 | 
| zdshelby | 0:f739ace74102 | 8 | |
| zdshelby | 0:f739ace74102 | 9 | #if (DEBUG_LEVEL) == 2 | 
| zdshelby | 0:f739ace74102 | 10 | #define DEBUG(x, ...) printf("[DEBUG: %s:%d] " x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); | 
| zdshelby | 9:5b116d75f41a | 11 | #define WARNING(x, ...) printf("[WARNING: %s:%d] " x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); | 
| zdshelby | 9:5b116d75f41a | 12 | #define ERROR(x, ...) printf("[ERROR: %s:%d] " x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__); | 
| zdshelby | 0:f739ace74102 | 13 | #elif (DEBUG_LEVEL) == 1 | 
| zdshelby | 0:f739ace74102 | 14 | #define DEBUG(x, ...) printf("[DEBUG] " x "\r\n", ##__VA_ARGS__); | 
| zdshelby | 9:5b116d75f41a | 15 | #define WARNING(x, ...) printf("[WARNING] " x "\r\n", ##__VA_ARGS__); | 
| zdshelby | 9:5b116d75f41a | 16 | #define ERROR(x, ...) printf("[ERROR] " x "\r\n", ##__VA_ARGS__); | 
| zdshelby | 0:f739ace74102 | 17 | #elif (DEBUG_LEVEL) == 0 | 
| zdshelby | 0:f739ace74102 | 18 | #define DEBUG(x, ...) | 
| zdshelby | 9:5b116d75f41a | 19 | #define WARNING(x, ...) | 
| zdshelby | 9:5b116d75f41a | 20 | #define ERROR(x, ...) | 
| zdshelby | 0:f739ace74102 | 21 | #endif | 
| zdshelby | 0:f739ace74102 | 22 | |
| zdshelby | 0:f739ace74102 | 23 | #endif // DEBUG_H | 
