Module: sip-router
Branch: master
Commit: 691f2633a3227787394bfbebf21803185c0ea914
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=691f263…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Wed Mar 19 22:15:12 2014 +0100
core: LOG_LN() new macro to print log messages overwriting log level name
---
dprint.h | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/dprint.h b/dprint.h
index f1df108..53bf829 100644
--- a/dprint.h
+++ b/dprint.h
@@ -167,11 +167,13 @@ void dprint_term_color(char f, char b, str *obuf);
# define LOG_(facility, level, prefix, fmt, ...)
# define LOG(level, fmt, ...)
# define LOG_FC(facility, level, fmt, ...)
+# define LOG_LN(level, lname, fmt, ...)
# else
# define LOG__(facility, level, lname, prefix, fmt, args...)
# define LOG_(facility, level, prefix, fmt, args...)
# define LOG(level, fmt, args...)
# define LOG_FC(facility, level, fmt, args...)
+# define LOG_LN(level, lname, fmt, args...)
# endif
#else
@@ -246,6 +248,11 @@ void dprint_term_color(char f, char b, str *obuf);
# define LOG_FC(facility, level, fmt, ...) \
LOG_((facility), (level), LOC_INFO, "%s(): " fmt,\
_FUNC_NAME_, __VA_ARGS__)
+
+# define LOG_LN(level, lname, fmt, ...) \
+ LOG__(DEFAULT_FACILITY, (level), (lname), LOC_INFO, "%s(): " fmt,\
+ _FUNC_NAME_, __VA_ARGS__)
+
# else /* LOG_FUNC_NAME */
# define LOG(level, fmt, ...) \
@@ -254,6 +261,9 @@ void dprint_term_color(char f, char b, str *obuf);
# define LOG_FC(facility, level, fmt, ...) \
LOG_((facility), (level), LOC_INFO, fmt, __VA_ARGS__)
+# define LOG_LN(level, lname, fmt, ...) \
+ LOG_(DEFAULT_FACILITY, (level), (lname), LOC_INFO, fmt, __VA_ARGS__)
+
# endif /* LOG_FUNC_NAME */
# else /* ! __SUNPRO_C */
@@ -316,11 +326,17 @@ void dprint_term_color(char f, char b, str *obuf);
# define LOG_FC(facility, level, fmt, args...) \
LOG_((facility), (level), LOC_INFO, "%s(): " fmt , _FUNC_NAME_, ## args)
+# define LOG_LN(level, lname, fmt, args...) \
+ LOG__(DEFAULT_FACILITY, (level), (lname), LOC_INFO, "%s(): " fmt ,\
+ _FUNC_NAME_, ## args)
+
# else /* LOG_FUNC_NAME */
# define LOG(level, fmt, args...) \
LOG_(DEFAULT_FACILITY, (level), LOC_INFO, fmt , ## args)
# define LOG_FC(facility, level, fmt, args...) \
LOG_((facility), (level), LOC_INFO, fmt , ## args)
+# define LOG_LN(level, lname, fmt, args...) \
+ LOG__(DEFAULT_FACILITY, (level), (lname), LOC_INFO, fmt , ## args)
# endif /* LOG_FUNC_NAME */
# endif /* __SUNPRO_C */