summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/common-utils.h
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-03-16 09:38:49 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-17 23:11:04 -0700
commit0a1f00cdcb087e00c184c62c1a9f22803c257cf2 (patch)
tree85b3ae636ec6084ec46a883ca7e090575eb60fba /libglusterfs/src/common-utils.h
parent0f39192ef6bc7b1c74cfaeb04ed21305996d67e9 (diff)
libglusterfs/src/*.c: log enhancement
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2346 (Log message enhancements in GlusterFS - phase 1) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
Diffstat (limited to 'libglusterfs/src/common-utils.h')
-rw-r--r--libglusterfs/src/common-utils.h55
1 files changed, 28 insertions, 27 deletions
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index 178eceea2..7a18b12cd 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -94,40 +94,41 @@ extern char *gf_mgmt_list[GF_MGMT_MAXVALUE];
#define VALIDATE_OR_GOTO(arg,label) do { \
if (!arg) { \
errno = EINVAL; \
- gf_log ((this ? this->name : "(Govinda! Govinda!)"), \
- GF_LOG_ERROR, \
- "invalid argument: " #arg); \
+ gf_log_callingfn ((this ? (this->name) : \
+ "(Govinda! Govinda!)"), \
+ GF_LOG_WARNING, \
+ "invalid argument: " #arg); \
goto label; \
} \
} while (0);
-#define GF_VALIDATE_OR_GOTO(name,arg,label) do { \
- if (!arg) { \
- errno = EINVAL; \
- gf_log (name, GF_LOG_ERROR, \
- "invalid argument: " #arg); \
- goto label; \
- } \
+#define GF_VALIDATE_OR_GOTO(name,arg,label) do { \
+ if (!arg) { \
+ errno = EINVAL; \
+ gf_log_callingfn (name, GF_LOG_ERROR, \
+ "invalid argument: " #arg); \
+ goto label; \
+ } \
} while (0);
#define GF_VALIDATE_OR_GOTO_WITH_ERROR(name, arg, label, errno, error) do { \
if (!arg) { \
errno = error; \
- gf_log (name, GF_LOG_ERROR, \
- "invalid argument: " #arg); \
+ gf_log_callingfn (name, GF_LOG_ERROR, \
+ "invalid argument: " #arg); \
goto label; \
} \
}while (0);
-#define GF_VALIDATE_ABSOLUTE_PATH_OR_GOTO(name,arg,label) \
- do { \
- GF_VALIDATE_OR_GOTO (name, arg, label); \
- if ((arg[0]) != '/') { \
- errno = EINVAL; \
- gf_log (name, GF_LOG_ERROR, \
- "invalid argument: " #arg); \
- goto label; \
- } \
+#define GF_VALIDATE_ABSOLUTE_PATH_OR_GOTO(name,arg,label) \
+ do { \
+ GF_VALIDATE_OR_GOTO (name, arg, label); \
+ if ((arg[0]) != '/') { \
+ errno = EINVAL; \
+ gf_log_callingfn (name, GF_LOG_ERROR, \
+ "invalid argument: " #arg); \
+ goto label; \
+ } \
} while (0);
#define GF_FILE_CONTENT_REQUESTED(_xattr_req,_content_limit) \
@@ -136,12 +137,12 @@ extern char *gf_mgmt_list[GF_MGMT_MAXVALUE];
#ifdef DEBUG
#define GF_ASSERT(x) assert (x);
#else
-#define GF_ASSERT(x)\
- do { \
- if (!(x)) { \
- gf_log_callingfn ("", GF_LOG_ERROR, \
- "Assertion failed: " #x); \
- } \
+#define GF_ASSERT(x) \
+ do { \
+ if (!(x)) { \
+ gf_log_callingfn ("", GF_LOG_ERROR, \
+ "Assertion failed: " #x); \
+ } \
} while (0);
#endif