Release 1.0.3
[platform/upstream/gsignond.git] / include / gsignond / gsignond-log.h
index 65af19f..fcb65e0 100644 (file)
@@ -25,6 +25,8 @@
 #ifndef __GSIGNOND_LOG_H_
 #define __GSIGNOND_LOG_H_
 
+#include "config.h"
+
 #include <glib.h>
 
 #include <execinfo.h>
 }
 
 /**
- * INFO:
+ * ERR:
  * @frmt: format string for the message
  * @...: arguments for the format string
  * 
- * Use this macro to log informational messages. GSignond will take care of
+ * Use this macro to log error messages. GSignond will take care of
  * correctly saving them.
  */
-#define INFO(frmt, args...) g_message("%f %s:%d %s " frmt , \
+#define ERR(frmt, args...)  g_critical("%f %s:%d %s " frmt , \
         g_get_monotonic_time()*1.0e-6, __FILE__, __LINE__, \
         __PRETTY_FUNCTION__, ##args)
 
 /**
- * ERR:
+ * WARN:
  * @frmt: format string for the message
  * @...: arguments for the format string
  * 
- * Use this macro to log error messages. GSignond will take care of
+ * Use this macro to log warning messages. GSignond will take care of
  * correctly saving them.
  */
-#define ERR(frmt, args...)  g_critical("%f %s:%d %s " frmt , \
+#define WARN(frmt, args...) g_warning("%f %s:%d %s " frmt , \
         g_get_monotonic_time()*1.0e-6, __FILE__, __LINE__, \
         __PRETTY_FUNCTION__, ##args)
 
+#ifdef ENABLE_DEBUG
 /**
- * WARN:
+ * INFO:
  * @frmt: format string for the message
  * @...: arguments for the format string
  * 
- * Use this macro to log warning messages. GSignond will take care of
+ * Use this macro to log informational messages. GSignond will take care of
  * correctly saving them.
  */
-#define WARN(frmt, args...) g_warning("%f %s:%d %s " frmt , \
+#define INFO(frmt, args...) g_message("%f %s:%d %s " frmt , \
         g_get_monotonic_time()*1.0e-6, __FILE__, __LINE__, \
         __PRETTY_FUNCTION__, ##args)
+
 /**
  * DBG:
  * @frmt: format string for the message
 #define DBG(frmt, args...)  g_debug("%f %s:%d %s " frmt , \
         g_get_monotonic_time()*1.0e-6, __FILE__, __LINE__, \
         __PRETTY_FUNCTION__, ##args)
+#else
+# define INFO(frmt, args...)
+# define DBG(frmt, args...)
+#endif
 
 #endif /* __GSIGNOND_LOG_H_ */