From 6d52dfb6646286f2dfd554dc008e96f9b13aade9 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 10 Sep 2010 20:24:07 +0000 Subject: logging: provide a API to print calling functions * logs 3 calling functions Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1493 (log enhancement to print calling function..) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1493 --- libglusterfs/src/logging.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libglusterfs/src/logging.h') diff --git a/libglusterfs/src/logging.h b/libglusterfs/src/logging.h index e440d5975..9da233fb2 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); -- cgit