summaryrefslogtreecommitdiffstats
path: root/libdm/misc
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2009-07-10 09:59:37 +0000
committerAlasdair Kergon <agk@redhat.com>2009-07-10 09:59:37 +0000
commita9cb6969b0f8e73d78e5e2d94e24ce55d549c517 (patch)
treefe9bb4d036429dd70e35449f68bd4b92f5d3386a /libdm/misc
parentf1c90ec108efa6f113be4ee0da65331f6e15877a (diff)
downloadlvm2-a9cb6969b0f8e73d78e5e2d94e24ce55d549c517.tar.gz
lvm2-a9cb6969b0f8e73d78e5e2d94e24ce55d549c517.tar.xz
lvm2-a9cb6969b0f8e73d78e5e2d94e24ce55d549c517.zip
Add dm_log_with_errno and dm_log_with_errno_init, deprecating the old
Change plog to use dm_log_with_errno unless deprecated dm_log_init was used. Rename plog macro to LOG_LINE and use in dm_dump_memory_debug.
Diffstat (limited to 'libdm/misc')
-rw-r--r--libdm/misc/dm-logging.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/libdm/misc/dm-logging.h b/libdm/misc/dm-logging.h
index b25bc55b..d2f23591 100644
--- a/libdm/misc/dm-logging.h
+++ b/libdm/misc/dm-logging.h
@@ -19,8 +19,15 @@
#include "libdevmapper.h"
extern dm_log_fn dm_log;
+extern dm_log_with_errno_fn dm_log_with_errno;
-#define plog(l, x...) dm_log(l, __FILE__, __LINE__, ## x)
+#define LOG_LINE(l, x...) \
+ do { \
+ if (dm_log_is_non_default()) \
+ dm_log(l, __FILE__, __LINE__, ## x); \
+ else \
+ dm_log_with_errno(l, __FILE__, __LINE__, 0, ## x); \
+ } while (0)
#include "log.h"