Commit 0e6e9197 authored by Francois Tessier's avatar Francois Tessier

Add debug messages in the custom printf feature

parent 4d7a562f
...@@ -32,10 +32,21 @@ void printMsg ( msg_t type, char* format, ... ) { ...@@ -32,10 +32,21 @@ void printMsg ( msg_t type, char* format, ... ) {
#endif #endif
break; break;
case TIMING: case TIMING:
#ifdef TIMING
#ifdef COLOR #ifdef COLOR
fprintf ( stdout, BLUE "[TIME]" RESET " %s", message); fprintf ( stdout, BLUE "[TIME]" RESET " %s", message);
#else #else
fprintf ( stdout, "[TIME] %s", message); 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 #endif
break; break;
default: default:
......
...@@ -6,11 +6,12 @@ ...@@ -6,11 +6,12 @@
#define RED "\x1b[31m" #define RED "\x1b[31m"
#define GREEN "\x1b[32m" #define GREEN "\x1b[32m"
#define BLUE "\x1b[34m"
#define YELLOW "\x1b[33m" #define YELLOW "\x1b[33m"
#define BLUE "\x1b[34m"
#define MAGENTA "\x1b[35m"
#define RESET "\x1b[0m" #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, ... ); 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