diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/log.h | 24 | ||||
-rw-r--r-- | src/log.c | 18 |
2 files changed, 42 insertions, 0 deletions
diff --git a/src/include/log.h b/src/include/log.h new file mode 100644 index 0000000..1ad592b --- /dev/null +++ b/src/include/log.h @@ -0,0 +1,24 @@ +#ifndef LOG_H +#define LOG_H + + +#include <stdio.h> + + +#define KNRM "\x1B[0m" +#define KRED "\x1B[31m" +#define KGRN "\x1B[32m" +#define KYEL "\x1B[33m" +#define KBLU "\x1B[34m" +#define KMAG "\x1B[35m" +#define KCYN "\x1B[36m" +#define KWHT "\x1B[37m" + + +void log_dbg(char* content); +void log_inf(char* content); +void log_war(char* content); +void log_err(char* content); + + +#endif diff --git a/src/log.c b/src/log.c new file mode 100644 index 0000000..3a899d3 --- /dev/null +++ b/src/log.c @@ -0,0 +1,18 @@ +#include "include/log.h" + + +void log_dbg(char* content) { + fprintf(stderr, KMAG "[DEBUG] %s%s\n", KNRM, content); +}; + +void log_inf(char* content) { + fprintf(stderr, KBLU "[INFO] %s%s\n", KNRM, content); +}; + +void log_war(char* content) { + fprintf(stderr, KYEL "[WARNING] %s%s\n", KNRM, content); +}; + +void log_err(char* content) { + fprintf(stderr, KRED "[ERROR] %s%s\n", KNRM, content); +}; |