diff --git a/src/ulog.h b/src/ulog.h index e6a55d0..04c3075 100644 --- a/src/ulog.h +++ b/src/ulog.h @@ -86,7 +86,7 @@ typedef enum { // There are two ways to enable uLog: you can uncomment the following // line, or -- if it is commented out -- you can add -DULOG_ENABLED to // your compiler switches. -//#define ULOG_ENABLED +#define ULOG_ENABLED #ifdef ULOG_ENABLED #define ULOG_INIT() ulog_init() diff --git a/tests/ulog_example.c b/tests/ulog_example.c index 239925c..ddefbe4 100644 --- a/tests/ulog_example.c +++ b/tests/ulog_example.c @@ -15,7 +15,9 @@ void my_console_logger(ulog_level_t severity, char *msg) { printf("console: %s [%s]: %s\n", "time", // user defined function - ulog_level_name(severity), +#if defined ULOG_ENABLED + ULOG_LEVEL_NAME(severity), +#endif msg); } @@ -23,7 +25,9 @@ void my_file_logger(ulog_level_t severity, char *msg) { printf("file: %s [%s]: %s\n", "time", // user defined function - ulog_level_name(severity), +#if defined ULOG_ENABLED + ULOG_LEVEL_NAME(severity), +#endif msg); }