Moved logging macros to base.h and use them everywhere

The macros used in the testing library are actually useful everywhere
so may as well use them.
This commit is contained in:
2024-07-07 03:16:42 +01:00
parent 74c5746bff
commit 7a5eee932a
5 changed files with 31 additions and 40 deletions

View File

@@ -24,16 +24,6 @@
#include <stdlib.h>
#include <string.h>
#define MESSAGE(FILE, COLOUR, NAME, FORMAT, ...) \
fprintf(FILE, "\t[" COLOUR "%s" TERM_RESET "]: " FORMAT, NAME, __VA_ARGS__)
#define INFO(NAME, FORMAT, ...) \
MESSAGE(stdout, TERM_YELLOW, NAME, FORMAT, __VA_ARGS__)
#define FAIL(NAME, FORMAT, ...) \
MESSAGE(stderr, TERM_RED, NAME, FORMAT, __VA_ARGS__)
#define SUCCESS(NAME, FORMAT, ...) \
MESSAGE(stdout, TERM_GREEN, NAME, FORMAT, __VA_ARGS__)
typedef void (*test_fn)(void);
struct Test
{