diff logging.h @ 252:d948e3ced2b9

Fix previous commit
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Thu, 28 May 2015 17:20:45 +0200
parents 307fd62f376d
children
line wrap: on
line diff
--- a/logging.h	Thu May 28 16:12:18 2015 +0200
+++ b/logging.h	Thu May 28 17:20:45 2015 +0200
@@ -14,16 +14,16 @@
 
 enum loglevel {
 	ERROR = 0,
-	DEBUG,
+	WARNING,
 	INFO,
-	WARNING,
+	DEBUG,
 };
 
-int __logger_init(struct logger *l, void(*onerror)(int, const char *));
+struct logger * __logger_init(void(*onerror)(int, const char *));
 void __logmessage(struct logger *l, enum loglevel level, const char *frmt, ...);
-int __logger_panel_visible(struct logger *l, int visible);
+void __logger_panel_visible(struct logger *l, int visible);
 
-#define logger_init(onerror) __logger_init(__logger, onerror)
+#define logger_init(onerror) do { __logger = __logger_init(onerror); } while (0)
 #define logmessage(level, msg, ...) __logmessage(__logger, (level), (msg), ##__VA_ARGS__)
 #define logmsg(msg, ...) __logmessage(__logger, INFO, msg, ##__VA_ARGS__)
 #define logger_panel_visible(visible)  __logger_panel_visible(__logger, visible)