aboutsummaryrefslogtreecommitdiff
path: root/src/log.c
blob: 4ce6ae86da3ae542f32e4297e1030820d4e92166 (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 "log.h"

#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>

static enum imv_log_level g_log_level = IMV_WARNING;

void imv_log_set_level(enum imv_log_level level)
{
  g_log_level = level;
}

void imv_log(enum imv_log_level level, const char *fmt,  ...)
{
  if (level > g_log_level) {
    return;
  }

  va_list args;
  va_start(args, fmt);
  vfprintf(stderr, fmt, args);
  va_end(args);
}