aboutsummaryrefslogtreecommitdiff
path: root/src/log.h
blob: 43b1894b481fbbbd125d9dbaca1f9c0183eeaa66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef IMV_LOG_H
#define IMV_LOG_H

enum imv_log_level {
  IMV_DEBUG,
  IMV_INFO,
  IMV_WARNING,
  IMV_ERROR
};

/* Write to the log */
void imv_log(enum imv_log_level level, const char *fmt,  ...);

typedef void (*imv_log_callback)(enum imv_log_level level, const char *text, void *data);

/* Subscribe to the log, callback is called whenever a log entry is written */
void imv_log_add_log_callback(imv_log_callback callback, void *data);

/* Unsubscribe from the log */
void imv_log_remove_log_callback(imv_log_callback callback);

#endif