[retro-gtk/wip/aplazas/logs: 1/3] log: Add retro_g_log()



commit 31f1b2226aadd6ec8bc461b77198524c972e970d
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Tue May 16 10:16:48 2017 +0200

    log: Add retro_g_log()
    
    This will be used to easily let clients log messages from the core in an
    easy way while keeping control over how the logging is done.

 retro-gtk/Makefile.am |    3 +++
 retro-gtk/retro-log.c |   10 ++++++++++
 retro-gtk/retro.vala  |    2 ++
 3 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/retro-gtk/Makefile.am b/retro-gtk/Makefile.am
index 5e26206..6002760 100644
--- a/retro-gtk/Makefile.am
+++ b/retro-gtk/Makefile.am
@@ -59,6 +59,7 @@ libretro_gtk_la_SOURCES = \
        retro.vala \
        retro-core-descriptor.vala \
        retro-core-descriptor-error.vala \
+       retro-log.c \
        retro-module-query.vala \
        retro-module-iterator.vala \
        rumble.vala \
@@ -79,6 +80,8 @@ retro-core.c: retro-gtk-internal.h
 
 retro-environment.c: retro-gtk-internal.h libretro-environment.h
 
+retro-log.c: retro-gtk-internal.h
+
 libretro_gtk_la_LDFLAGS =
 
 libretro_gtk_la_VALAFLAGS = \
diff --git a/retro-gtk/retro-log.c b/retro-gtk/retro-log.c
new file mode 100644
index 0000000..070d6b2
--- /dev/null
+++ b/retro-gtk/retro-log.c
@@ -0,0 +1,10 @@
+#include "retro-gtk-internal.h"
+
+void
+retro_g_log (RetroCore      *self,
+             const gchar    *log_domain,
+             GLogLevelFlags  log_level,
+             const gchar    *message)
+{
+  g_log (log_domain, log_level, "%s", message);
+}
diff --git a/retro-gtk/retro.vala b/retro-gtk/retro.vala
index b2ecb40..09a4017 100644
--- a/retro-gtk/retro.vala
+++ b/retro-gtk/retro.vala
@@ -40,5 +40,7 @@ public SystemInfo? get_system_info (string module_name) {
        return info;
 }
 
+public extern void g_log (Core core, string log_domain, LogLevelFlags log_level, string message);
+
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]