aboutsummaryrefslogtreecommitdiff
path: root/src/log.c
blob: f22895a24276a6bcb4990d5002edf6ca26c11bdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>
#include <stdarg.h>

#include "log.h"

// I know... It is what it is...
static LogLevel global_level;

void log_init(LogLevel level)
{
    global_level = level;
}

void log_generic(LogLevel level, const char *format, ...)
{
    if (level < global_level) return;

    va_list args;
    va_start(args, format);
    vfprintf(level >= LOG_WARN ? stderr : stdout, format, args);
    va_end(args);
}

// vim: ts=4 sw=4 et