summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/logging.h
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-10 20:24:07 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-13 06:44:50 -0700
commit6d52dfb6646286f2dfd554dc008e96f9b13aade9 (patch)
tree0e167503e0987d728f3de931305ca18152808be4 /libglusterfs/src/logging.h
parentd0ee998f5c997cfdebd0b7ff4bcbc9b2ea74c1ff (diff)
logging: provide a API to print calling functions
* logs 3 calling functions Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1493 (log enhancement to print calling function..) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1493
Diffstat (limited to 'libglusterfs/src/logging.h')
-rw-r--r--libglusterfs/src/logging.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libglusterfs/src/logging.h b/libglusterfs/src/logging.h
index e440d597549..9da233fb2b8 100644
--- a/libglusterfs/src/logging.h
+++ b/libglusterfs/src/logging.h
@@ -82,6 +82,13 @@ extern char gf_log_xl_log_set;
levl, ##fmt); \
} while (0)
+#define gf_log_callingfn(dom, levl, fmt...) do { \
+ if ((levl > gf_log_loglevel) && !gf_log_xl_log_set) \
+ break; \
+ _gf_log_callingfn (dom, __FILE__, __FUNCTION__, __LINE__, \
+ levl, ##fmt); \
+ } while (0)
+
/* Log once in GF_UNIVERSAL_ANSWER times */
#define GF_LOG_OCCASIONALLY(var, args...) if (!(var++%GF_UNIVERSAL_ANSWER)) { \
gf_log (args); \
@@ -97,6 +104,9 @@ void gf_log_cleanup (void);
int
_gf_log (const char *domain, const char *file, const char *function,
int32_t line, gf_loglevel_t level, const char *fmt, ...);
+int
+_gf_log_callingfn (const char *domain, const char *file, const char *function,
+ int32_t line, gf_loglevel_t level, const char *fmt, ...);
int
gf_log_from_client (const char *msg, char *identifier);