Commit 3df87826 authored by Marcus Sundberg's avatar Marcus Sundberg

Always use the same err_reporting_level_t definition regardless of whether using syslog or not.

parent 9796c1a3
......@@ -97,49 +97,29 @@ typedef enum {
* @}
*/
#ifdef ERR_REPORTING_SYSLOG
#include <syslog.h>
typedef enum {
err_level_emergency = LOG_EMERG,
err_level_alert = LOG_ALERT,
err_level_critical = LOG_CRIT,
err_level_error = LOG_ERR,
err_level_warning = LOG_WARNING,
err_level_notice = LOG_NOTICE,
err_level_info = LOG_INFO,
err_level_debug = LOG_DEBUG,
err_level_none
} err_reporting_level_t;
#else
typedef enum {
err_level_emergency,
err_level_alert,
err_level_critical,
err_level_error,
err_level_warning,
err_level_notice,
err_level_info,
err_level_emergency = 0,
err_level_alert,
err_level_critical,
err_level_error,
err_level_warning,
err_level_notice,
err_level_info,
err_level_debug,
err_level_none
} err_reporting_level_t;
#endif
/*
* err_reporting_init prepares the error system. If
* ERR_REPORTING_SYSLOG is defined, it will open syslog.
*
* The ident argument is a string that will be prepended to
* all syslog messages. It is conventionally argv[0].
* all syslog messages. It is conventionally argv[0].
*/
err_status_t
err_reporting_init(char *ident);
/*
* keydaemon_report_error reports a 'printf' formatted error
* string, followed by a an arg list. The priority argument
......@@ -155,10 +135,10 @@ err_report(int priority, char *format, ...);
/*
* debug_module_t defines a debug module
* debug_module_t defines a debug module
*/
typedef struct {
typedef struct {
int on; /* 1 if debugging is on, 0 if it is off */
char *name; /* printable name for debug module */
} debug_module_t;
......@@ -175,14 +155,14 @@ typedef struct {
#define debug_print2(mod, format, arg1,arg2) \
if (mod.on) err_report(err_level_debug, ("%s: " format "\n"), mod.name, arg1,arg2)
#else
#else
/* define macros to do nothing */
#define debug_print(mod, format, arg)
#define debug_print(mod, format, arg)
#define debug_on(mod)
#define debug_on(mod)
#define debug_off(mod)
#define debug_off(mod)
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment