Update of /cvsroot/dhcp-agent/dhcp-agent
In directory usw-pr-cvs1:/tmp/cvs-serv600
Modified Files:
dhcp-util.c dhcp-util.h
Log Message:
bug fix to messaging
Index: dhcp-util.c
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-util.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** dhcp-util.c 22 Oct 2002 00:46:14 -0000 1.28
--- dhcp-util.c 23 Oct 2002 16:27:49 -0000 1.29
***************
*** 60,64 ****
/* message proc workhorse */
static void message_proc(const char *prefix, const char *module_name, const char *func_name,
! const char *file, const char *line, const char *fmt, va_list ap)
{
static stringbuffer *prefix_sb = NULL;
--- 60,64 ----
/* message proc workhorse */
static void message_proc(const char *prefix, const char *module_name, const char *func_name,
! const char *file, const char *fmt, va_list ap)
{
static stringbuffer *prefix_sb = NULL;
***************
*** 81,85 ****
message_append_colon_sep(prefix_sb, func_name);
message_append_colon_sep(prefix_sb, file);
- message_append_colon_sep(prefix_sb, line);
stringbuffer_avprintf(msg_sb, fmt, ap);
--- 81,84 ----
***************
*** 108,112 ****
va_start(ap, fmt);
! message_proc("error", NULL, func_name, NULL, NULL, fmt, ap);
va_end(ap);
--- 107,111 ----
va_start(ap, fmt);
! message_proc("error", NULL, func_name, NULL, fmt, ap);
va_end(ap);
***************
*** 125,129 ****
va_start(ap, fmt);
! message_proc("fatal", NULL, func_name, NULL, NULL, fmt, ap);
va_end(ap);
--- 124,128 ----
va_start(ap, fmt);
! message_proc("fatal", NULL, func_name, NULL, fmt, ap);
va_end(ap);
***************
*** 142,146 ****
va_start(ap, fmt);
! message_proc(NULL, NULL, NULL, NULL, NULL, fmt, ap);
va_end(ap);
--- 141,145 ----
va_start(ap, fmt);
! message_proc(NULL, NULL, NULL, NULL, fmt, ap);
va_end(ap);
***************
*** 159,163 ****
va_start(ap, fmt);
! message_proc("warning", NULL, NULL, NULL, NULL, fmt, ap);
va_end(ap);
--- 158,162 ----
va_start(ap, fmt);
! message_proc("warning", NULL, NULL, NULL, fmt, ap);
va_end(ap);
***************
*** 167,181 ****
/* send debug message. */
! void debug_message(const char *module_name, const char *func, const char *file, const char *line, const char *fmt, ...)
{
va_list ap;
! if(get_verbosity_level() <= DEBUG_VERBOSITY_LEVEL)
return;
va_start(ap, fmt);
! message_proc("debug", module_name, func, file, line, fmt, ap);
va_end(ap);
--- 166,180 ----
/* send debug message. */
! void debug_message(const char *module_name, const char *func, const char *file, const char *fmt, ...)
{
va_list ap;
! if(get_verbosity_level() < DEBUG_VERBOSITY_LEVEL)
return;
va_start(ap, fmt);
! message_proc("debug", module_name, func, file, fmt, ap);
va_end(ap);
Index: dhcp-util.h
===================================================================
RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-util.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** dhcp-util.h 13 Oct 2002 16:29:42 -0000 1.13
--- dhcp-util.h 23 Oct 2002 16:27:49 -0000 1.14
***************
*** 41,45 ****
extern void info_message(const char *fmt, ...);
extern void warn_message(char *fmt, ...);
! extern void debug_message(const char *module_name, const char *func, const char *file, const char *line, const char *fmt, ...);
/* verbosity levels. */
--- 41,45 ----
extern void info_message(const char *fmt, ...);
extern void warn_message(char *fmt, ...);
! extern void debug_message(const char *module_name, const char *func, const char *file, const char *fmt, ...);
/* verbosity levels. */
***************
*** 98,102 ****
#define WARN_MESSAGE(...) { warn_message(__VA_ARGS__); }
#define FATAL_MESSAGE(...) { fatal_message(__func__, __VA_ARGS__); }
! #define DEBUG_MESSAGE(...) { debug_message(MODULE_NAME,___func__, __VA_ARGS__); }
#endif /* DHCP_UTIL_H */
--- 98,102 ----
#define WARN_MESSAGE(...) { warn_message(__VA_ARGS__); }
#define FATAL_MESSAGE(...) { fatal_message(__func__, __VA_ARGS__); }
! #define DEBUG_MESSAGE(...) { debug_message(MODULE_NAME, __func__, __FILE__, __VA_ARGS__); }
#endif /* DHCP_UTIL_H */
|