Zach Shelby / Mbed 2 deprecated NanoService_MTS_Cellular_Simple

Dependencies:   mbed SocketModem nanoservice_client_1_12

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers debug.h Source File

debug.h

00001 #ifndef DEBUG_H
00002 #define DEBUG_H
00003 
00004 #include "mbed.h"
00005 
00006 // Set the debugging level, 0 = off, 1 = simple, 2 = detailed
00007 #define DEBUG_LEVEL 1
00008 
00009 #if (DEBUG_LEVEL) == 2
00010 #define DEBUG(x, ...) printf("[DEBUG: %s:%d] " x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
00011 #define WARNING(x, ...) printf("[WARNING: %s:%d] " x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
00012 #define ERROR(x, ...) printf("[ERROR: %s:%d] " x "\r\n", __FILE__, __LINE__, ##__VA_ARGS__);
00013 #elif (DEBUG_LEVEL) == 1
00014 #define DEBUG(x, ...) printf("[DEBUG] " x "\r\n", ##__VA_ARGS__);
00015 #define WARNING(x, ...) printf("[WARNING] " x "\r\n", ##__VA_ARGS__);
00016 #define ERROR(x, ...) printf("[ERROR] " x "\r\n", ##__VA_ARGS__);
00017 #elif (DEBUG_LEVEL) == 0
00018 #define DEBUG(x, ...)
00019 #define WARNING(x, ...)
00020 #define ERROR(x, ...)
00021 #endif
00022 
00023 #endif // DEBUG_H