Files
RedScarfEngine/utilities/src/logger.c
T
Piotr Krygier f5ab5f3f27 Improve testing framework
Replaced Criterrion with CMock. Added few tests, currently not working
properly. Random test upgrades.
2025-06-20 13:44:33 +02:00

26 lines
535 B
C

#include "logger.h"
#include "stdarg.h"
const char* log_levels[] = {
"[TRACE]", "[DEBUG]", "[INFO]", "WARNING", "[ERROR]", "[FATAL]"
};
#ifndef LOGLEVEL
#define LOGLEVEL LOGLEVEL_DEBUG
#endif
void _log_log(unsigned int level, const char* file, int line, const char* fmt, ...)
{
va_list list;
if (level < LOGLEVEL)
{
return;
}
va_start(list, fmt);
fprintf(stdout, "%s %s:%d: ", log_levels[level], file, line);
vfprintf(stdout, fmt, list);
fprintf(stdout, "\n");
fflush(stdout);
}