Mercurial > trustbridge
comparison 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 |
comparison
equal
deleted
inserted
replaced
614:de1e3a47ed21 | 615:2a4f7364ab81 |
---|---|
16 * @file | 16 * @file |
17 * @brief Logging and debugging functions | 17 * @brief Logging and debugging functions |
18 */ | 18 */ |
19 | 19 |
20 #include <stdio.h> | 20 #include <stdio.h> |
21 | |
22 /** @def Maximum length of log messages */ | |
23 #define MAX_LOG 511 | |
24 | |
25 /** @def The name used for logging */ | |
26 #define LOG_NAME "TrustBridge" | |
21 | 27 |
22 #ifdef WIN32 | 28 #ifdef WIN32 |
23 | 29 |
24 #include <windows.h> | 30 #include <windows.h> |
25 | 31 |
106 free (my_error); \ | 112 free (my_error); \ |
107 } \ | 113 } \ |
108 ERRORPRINTF ("Failed to get error information\n"); | 114 ERRORPRINTF ("Failed to get error information\n"); |
109 | 115 |
110 | 116 |
117 /** | |
118 * @brief log an informational message into the syslog / event log | |
119 * | |
120 * The message length is limited to MAX_LOG characters. Log messages | |
121 * are expected to be in UTF-8 encoding. | |
122 * | |
123 * Function paramters are the same as for the printf familiy. | |
124 */ | |
125 void syslog_info_printf(const char *format, ...); | |
126 | |
127 /** | |
128 * @brief log an error message into the syslog / event log | |
129 * | |
130 * The message length is limited to MAX_LOG characters. Log messages | |
131 * are expected to be in UTF-8 encoding. | |
132 * | |
133 * Function paramters are the same as for the printf familiy. | |
134 */ | |
135 void syslog_error_printf(const char *format, ...); | |
136 | |
111 #ifdef __cplusplus | 137 #ifdef __cplusplus |
112 } | 138 } |
113 #endif | 139 #endif |
114 | 140 |
115 #endif /* COMMON_LOGGING_H */ | 141 #endif /* COMMON_LOGGING_H */ |