From 7a640bd0622caf8a3354934d0400e8c361cdeee3 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Tue, 26 Oct 2021 17:00:14 +0100 Subject: Add EGL setup (unused for now). --- src/log.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/log.c (limited to 'src/log.c') diff --git a/src/log.c b/src/log.c new file mode 100644 index 0000000..eb4d165 --- /dev/null +++ b/src/log.c @@ -0,0 +1,40 @@ +#include + +void log_error(const char *const fmt, ...) +{ + va_list args; + va_start(args, fmt); + fprintf(stderr, "[ERROR]: "); + vfprintf(stderr, fmt, args); + va_end(args); +} + +void log_warning(const char *const fmt, ...) +{ + va_list args; + va_start(args, fmt); + fprintf(stderr, "[WARNING]: "); + vfprintf(stderr, fmt, args); + va_end(args); +} + +void log_debug(const char *const fmt, ...) +{ +#ifndef DEBUG + return; +#endif + va_list args; + va_start(args, fmt); + printf("[DEBUG]: "); + vprintf(fmt, args); + va_end(args); +} + +void log_info(const char *const fmt, ...) +{ + va_list args; + va_start(args, fmt); + printf("[INFO]: "); + vprintf(fmt, args); + va_end(args); +} -- cgit v1.2.3