[sr-dev] git:master:53ca8b50: core: check logging protection before the level

Daniel-Constantin Mierla miconda at gmail.com
Mon Jan 20 08:51:01 CET 2020


Module: kamailio
Branch: master
Commit: 53ca8b50207ca35f16a2315efb1ed29448961da8
URL: https://github.com/kamailio/kamailio/commit/53ca8b50207ca35f16a2315efb1ed29448961da8

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-01-20T08:50:44+01:00

core: check logging protection before the level

---

Modified: src/core/dprint.h

---

Diff:  https://github.com/kamailio/kamailio/commit/53ca8b50207ca35f16a2315efb1ed29448961da8.diff
Patch: https://github.com/kamailio/kamailio/commit/53ca8b50207ca35f16a2315efb1ed29448961da8.patch

---

diff --git a/src/core/dprint.h b/src/core/dprint.h
index c3096c5555..255976985e 100644
--- a/src/core/dprint.h
+++ b/src/core/dprint.h
@@ -214,8 +214,8 @@ void log_prefix_init(void);
 #	ifdef __SUNPRO_C
 #		define LOG__(facility, level, lname, prefix, fmt, ...) \
 			do { \
-				if (get_debug_level(LOG_MNAME, LOG_MNAME_LEN) >= (level) && \
-						DPRINT_NON_CRIT) { \
+				if (DPRINT_NON_CRIT \
+						&& get_debug_level(LOG_MNAME, LOG_MNAME_LEN) >= (level)) { \
 					int __llevel; \
 					__llevel = ((level)<L_ALERT)?L_ALERT:(((level)>L_DBG)?L_DBG:level); \
 					DPRINT_CRIT_ENTER; \
@@ -292,8 +292,8 @@ void log_prefix_init(void);
 #	else /* ! __SUNPRO_C */
 #		define LOG__(facility, level, lname, prefix, fmt, args...) \
 			do { \
-				if (get_debug_level(LOG_MNAME, LOG_MNAME_LEN) >= (level) && \
-						DPRINT_NON_CRIT) { \
+				if (DPRINT_NON_CRIT \
+						&& get_debug_level(LOG_MNAME, LOG_MNAME_LEN) >= (level) ) { \
 					int __llevel; \
 					__llevel = ((level)<L_ALERT)?L_ALERT:(((level)>L_DBG)?L_DBG:level); \
 					DPRINT_CRIT_ENTER; \




More information about the sr-dev mailing list