aboutsummaryrefslogtreecommitdiff
path: root/src/log.h
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-06-15 14:28:29 +0100
committerHarry Jeffery <harry@exec64.co.uk>2019-07-03 20:50:19 +0100
commit7c7dc660e587eac1aa3c8b3405eba95ba558e682 (patch)
tree81d12d560b60d397be23c7d132e32a5de30e409a /src/log.h
parent20e9d23b82f55a751c3cf1166cb59ef26775ee00 (diff)
downloadimv-7c7dc660e587eac1aa3c8b3405eba95ba558e682.tar.gz
Big glfw refactor
I did a lot of this in a very ad-hoc fashion with no proper commit history. As such, the kindest thing to do seemed to be to just squash it into this one commit.
Diffstat (limited to 'src/log.h')
-rw-r--r--src/log.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/log.h b/src/log.h
index a426289..43b1894 100644
--- a/src/log.h
+++ b/src/log.h
@@ -8,8 +8,15 @@ enum imv_log_level {
IMV_ERROR
};
-void imv_log_set_level(enum imv_log_level level);
-
+/* 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