~exec64/imv

ref: 4c0123bb3b449a2ea45b3e831db725d853bb03a1 imv/src/log.h -rw-r--r-- 542 bytes
4c0123bb — Harry Jeffery Release v4.0.1 3 years ago
                                                                                
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