diff options
author | Russ Dill | 2002-10-14 21:41:28 +0000 |
---|---|---|
committer | Russ Dill | 2002-10-14 21:41:28 +0000 |
commit | 61fb48930f45aa536584b2047f9e703186e8f69f (patch) | |
tree | e3b93e0a694be81939f8c4762553c43ffdb9b10b /networking/udhcp/debug.h | |
parent | 9060a7315980bb05f42eab76b88746d43e138188 (diff) | |
download | busybox-61fb48930f45aa536584b2047f9e703186e8f69f.zip busybox-61fb48930f45aa536584b2047f9e703186e8f69f.tar.gz |
added full udhcp integration
Diffstat (limited to 'networking/udhcp/debug.h')
-rw-r--r-- | networking/udhcp/debug.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/networking/udhcp/debug.h b/networking/udhcp/debug.h new file mode 100644 index 0000000..a1e1974 --- /dev/null +++ b/networking/udhcp/debug.h @@ -0,0 +1,41 @@ +#ifndef _DEBUG_H +#define _DEBUG_H + +#include "libbb_udhcp.h" + +#include <stdio.h> +#ifdef SYSLOG +#include <syslog.h> +#endif + + +#ifdef SYSLOG +# define LOG(level, str, args...) do { printf(str, ## args); \ + printf("\n"); \ + syslog(level, str, ## args); } while(0) +# define OPEN_LOG(name) openlog(name, 0, 0) +#define CLOSE_LOG() closelog() +#else +# define LOG_EMERG "EMERGENCY!" +# define LOG_ALERT "ALERT!" +# define LOG_CRIT "critical!" +# define LOG_WARNING "warning" +# define LOG_ERR "error" +# define LOG_INFO "info" +# define LOG_DEBUG "debug" +# define LOG(level, str, args...) do { printf("%s, ", level); \ + printf(str, ## args); \ + printf("\n"); } while(0) +# define OPEN_LOG(name) do {;} while(0) +#define CLOSE_LOG() do {;} while(0) +#endif + +#ifdef DEBUG +# undef DEBUG +# define DEBUG(level, str, args...) LOG(level, str, ## args) +# define DEBUGGING +#else +# define DEBUG(level, str, args...) do {;} while(0) +#endif + +#endif |