From: Howard Chu Date: Fri, 10 May 2002 17:48:54 +0000 (+0000) Subject: Fleshed out debug2syslog X-Git-Tag: OPENLDAP_REL_ENG_2_MP~77 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9979d200db438c57bd4066af4df8eb813c545708;p=openldap Fleshed out debug2syslog --- diff --git a/libraries/liblutil/debug.c b/libraries/liblutil/debug.c index 6cebce7da9..1d47361d8e 100644 --- a/libraries/liblutil/debug.c +++ b/libraries/liblutil/debug.c @@ -13,6 +13,10 @@ #include #include +#ifdef LDAP_SYSLOG +#include +#endif + #include "ldap_log.h" #include "ldap_defaults.h" #include "lber.h" @@ -29,19 +33,22 @@ static long numLevels = 0; static FILE *log_file = NULL; static int global_level = 0; -#if 0 #ifdef LDAP_SYSLOG static int use_syslog = 0; static int debug2syslog(int l) { switch (l) { - /* insert mapping cases here */ - default: + case LDAP_LEVEL_EMERG: return LOG_EMERG; + case LDAP_LEVEL_ALERT: return LOG_ALERT; + case LDAP_LEVEL_CRIT: return LOG_CRIT; + case LDAP_LEVEL_ERR: return LOG_ERR; + case LDAP_LEVEL_WARNING: return LOG_WARNING; + case LDAP_LEVEL_NOTICE: return LOG_NOTICE; + case LDAP_LEVEL_INFO: return LOG_INFO; } - return LOG_DEBUG + return LOG_DEBUG; } #endif -#endif static char *lutil_levels[] = {"emergency", "alert", "critical", "error", "warning", "notice", @@ -142,7 +149,6 @@ void lutil_log_int( return; } -#if 0 #ifdef LDAP_SYSLOG /* we're configured to use syslog */ if( use_syslog ) { @@ -150,7 +156,6 @@ void lutil_log_int( return; } #endif -#endif #if 0 #ifdef HAVE_WINSOCK