diff common/logging.h @ 615:2a4f7364ab81

Add first simple event logging functions
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 19 Jun 2014 11:53:07 +0200
parents 5e2af38266f6
children 5042ace08cba
line wrap: on
line diff
--- a/common/logging.h	Wed Jun 18 16:35:03 2014 +0200
+++ b/common/logging.h	Thu Jun 19 11:53:07 2014 +0200
@@ -19,6 +19,12 @@
 
 #include <stdio.h>
 
+/** @def Maximum length of log messages */
+#define MAX_LOG 511
+
+/** @def The name used for logging */
+#define LOG_NAME "TrustBridge"
+
 #ifdef WIN32
 
 #include <windows.h>
@@ -108,6 +114,26 @@
   ERRORPRINTF ("Failed to get error information\n");
 
 
+/**
+ * @brief log an informational message into the syslog / event log
+ *
+ * The message length is limited to MAX_LOG characters. Log messages
+ * are expected to be in UTF-8 encoding.
+ *
+ * Function paramters are the same as for the printf familiy.
+ */
+void syslog_info_printf(const char *format, ...);
+
+/**
+ * @brief log an error message into the syslog / event log
+ *
+ * The message length is limited to MAX_LOG characters. Log messages
+ * are expected to be in UTF-8 encoding.
+ *
+ * Function paramters are the same as for the printf familiy.
+ */
+void syslog_error_printf(const char *format, ...);
+
 #ifdef __cplusplus
 }
 #endif

http://wald.intevation.org/projects/trustbridge/