diff options
author | Kevin Coffman <kwc@citi.umich.edu> | 2007-10-12 16:35:15 -0400 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2007-10-15 09:50:56 +1000 |
commit | f0a6165a611c28e94513b1c2df5826b23d154ba4 (patch) | |
tree | 2f816abdfb824009a75ae55b3723a55d61ab9af3 /support/include/xlog.h | |
parent | bb5eb9d268938023b59896912d598d3ba1a88c90 (diff) | |
download | nfs-utils-f0a6165a611c28e94513b1c2df5826b23d154ba4.tar.gz nfs-utils-f0a6165a611c28e94513b1c2df5826b23d154ba4.tar.xz nfs-utils-f0a6165a611c28e94513b1c2df5826b23d154ba4.zip |
Cleanup xlog logging code to be safe and usable for all
This patch reworks the xlog logging code to avoid rebuilding the message into a
fixed size buffer. It also adds two new logging functions xlog_warn and
xlog_err which are replacements for idmap_warn and idmap_err. There use to be
two different variates of these functions with the only difference being that
one flavor tacked on the error string to the end of the message. This
responsibility has been pushed to the called of the function since it
needlessly complicated the function and required us to rebuild the message
strings.
Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov>
Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'support/include/xlog.h')
-rw-r--r-- | support/include/xlog.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/support/include/xlog.h b/support/include/xlog.h index cf9bc91..fd1a3f4 100644 --- a/support/include/xlog.h +++ b/support/include/xlog.h @@ -7,6 +7,8 @@ #ifndef XLOG_H #define XLOG_H +#include <stdarg.h> + /* These are logged always. L_FATAL also does exit(1) */ #define L_FATAL 0x0100 #define L_ERROR 0x0200 @@ -40,5 +42,8 @@ void xlog_config(int fac, int on); void xlog_sconfig(char *, int on); int xlog_enabled(int fac); void xlog(int fac, const char *fmt, ...); +void xlog_warn(const char *fmt, ...); +void xlog_err(const char *fmt, ...); +void xlog_backend(int fac, const char *fmt, va_list args); #endif /* XLOG_H */ |