2023-04-06 18:54:30 +02:00
|
|
|
#include <defocus/base.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
static const char *log_level_names[] = {"VERBOSE", "INFO", "WARN", "ERROR"};
|
|
|
|
|
2023-05-09 13:04:14 +02:00
|
|
|
DF_API void df_log_impl(int level, const char *file, int line, const char *fmt, ...)
|
2023-04-06 18:54:30 +02:00
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_start(ap, fmt);
|
|
|
|
fprintf(stderr, "[%s] %s:%d: ", log_level_names[level], file, line);
|
|
|
|
vfprintf(stderr, fmt, ap);
|
|
|
|
fprintf(stderr, "\n");
|
|
|
|
va_end(ap);
|
|
|
|
}
|