Skip to content
Snippets Groups Projects
Commit 0c22d42a authored by Utz-Uwe Haus's avatar Utz-Uwe Haus
Browse files

fix conflict between logging macros and syslog log levels

parent 4dd3dbf6
No related branches found
No related tags found
2 merge requests!3Jsc ci update,!2update JSC-CI branch to devel
Pipeline #50995 failed
......@@ -35,9 +35,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "maestro/env.h"
#include "maestro/i_globals.h"
#include "maestro/i_statistics.h"
#include <errno.h>
#include <ctype.h>
......@@ -46,8 +43,7 @@
#include <pthread_np.h>
#endif /* HAVE_PTHREAD_NP_H */
#include "maestro/logging.h"
/* Careful! Syslog defines some constants that we use as macros (like LOG_ERR) */
#ifdef HAVE_SYSLOG
# include <syslog.h>
# ifndef MSTRO_LOG_SYSLOG_FACILITY
......@@ -56,17 +52,34 @@
# define MSTRO_LOG_SYSLOG_FACILITY LOG_LOCAL0
# endif
static const int g_syslog_err = LOG_ERR;
static const int g_syslog_warning = LOG_WARNING;
static const int g_syslog_info = LOG_INFO;
static const int g_syslog_debug = LOG_DEBUG;
#undef LOG_ERR
#undef LOG_WARNING
#undef LOG_INFO
#undef LOG_DEBUG
#include "maestro/logging.h"
/* convert maestro log levels to syslog levels */
static int mstro_loglevel2syslog[MSTRO_log__MAX] = {
[MSTRO_LOG_ERR] = LOG_ERR,
[MSTRO_LOG_WARN] = LOG_WARNING,
[MSTRO_LOG_INFO] = LOG_INFO,
[MSTRO_LOG_DEBUG] = LOG_DEBUG,
[MSTRO_LOG_NOISE] = LOG_DEBUG
[MSTRO_LOG_ERR] = g_syslog_err,
[MSTRO_LOG_WARN] = g_syslog_warning,
[MSTRO_LOG_INFO] = g_syslog_info,
[MSTRO_LOG_DEBUG] = g_syslog_debug,
[MSTRO_LOG_NOISE] = g_syslog_debug
};
#endif
#endif /* SYSLOG */
#include "maestro/logging.h"
#include "maestro/env.h"
#include "maestro/i_globals.h"
#include "maestro/i_statistics.h"
/** log to stderr */
#define MSTRO_LOG_DST_STDERR 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment