Commit 7bde1c6b authored by Francois Tessier's avatar Francois Tessier

Add debug messages in the custom printf feature

parent ee3350c4
......@@ -32,10 +32,21 @@ void printMsg ( msg_t type, char* format, ... ) {
#endif
break;
case TIMING:
#ifdef TIMING
#ifdef COLOR
fprintf ( stdout, BLUE "[TIME]" RESET " %s", message);
#else
fprintf ( stdout, "[TIME] %s", message);
#endif
#endif
break;
case DEBUG:
#ifdef DBG
#ifdef COLOR
fprintf ( stdout, MAGENTA "[DEBUG]" RESET " %s", message);
#else
fprintf ( stdout, "[ERR] %s", message);
#endif
#endif
break;
default:
......
......@@ -6,11 +6,12 @@
#define RED "\x1b[31m"
#define GREEN "\x1b[32m"
#define BLUE "\x1b[34m"
#define YELLOW "\x1b[33m"
#define BLUE "\x1b[34m"
#define MAGENTA "\x1b[35m"
#define RESET "\x1b[0m"
typedef enum { ERROR, WARNING, INFO, TIMING } msg_t;
typedef enum { ERROR, WARNING, INFO, TIMING, DEBUG } msg_t;
void printMsg ( msg_t type, char* format, ... );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment