summaryrefslogtreecommitdiffstats
path: root/lib/log/log.h
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2001-10-10 16:36:32 +0000
committerAlasdair Kergon <agk@redhat.com>2001-10-10 16:36:32 +0000
commit2d9133bbbdfe1019f7dd0da9a9e2bb3d863779ad (patch)
tree0fda3c837f6e05d2b64e74ed0900f362f23b165d /lib/log/log.h
parent758b8b4ba03b8f0b63216324e6c548dad78a9bfe (diff)
downloadlvm2-2d9133bbbdfe1019f7dd0da9a9e2bb3d863779ad.tar.gz
lvm2-2d9133bbbdfe1019f7dd0da9a9e2bb3d863779ad.tar.xz
lvm2-2d9133bbbdfe1019f7dd0da9a9e2bb3d863779ad.zip
standardise some log messages
Diffstat (limited to 'lib/log/log.h')
-rw-r--r--lib/log/log.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/log/log.h b/lib/log/log.h
index 19786cdd..8e16d8a1 100644
--- a/lib/log/log.h
+++ b/lib/log/log.h
@@ -42,10 +42,8 @@ void print_log(int level, const char *file, int line, const char *format, ...)
#define log_warn(x...) plog(_LOG_WARN, x)
#define log_err(x...) plog(_LOG_ERR, x)
#define log_fatal(x...) plog(_LOG_FATAL, x)
-#define log_sys_err(x) log_debug("system call '%s' failed (%s)", \
- x, strerror(errno))
-#define stack log_debug( "stack trace" )
+#define stack log_debug( "s" )
/*
* Macros to use for messages:
@@ -55,6 +53,7 @@ void print_log(int level, const char *file, int line, const char *format, ...)
* log_verbose - print to stdout if verbose is set (-v)
* log_very_verbose - print to stdout if verbose is set twice (-vv)
* log_debug - print to stdout if verbose is set three times (-vvv)
+ * (suppressed if single-character string such as with 'stack')
*
* In addition, messages will be logged to file or syslog if they
* are more serious than the log level specified with -d.
@@ -65,6 +64,12 @@ void print_log(int level, const char *file, int line, const char *format, ...)
#define log_verbose(fmt, args...) log_notice(fmt , ## args)
#define log_very_verbose(fmt, args...) log_info(fmt , ## args)
+/* System call equivalents */
+#define log_sys_error(x, y) \
+ log_err("%s: %s failed: %s", y, x, strerror(errno))
+#define log_sys_very_verbose(x, y) \
+ log_info("%s: %s failed: %s", y, x, strerror(errno))
+
#endif
/*