[sr-dev] git:5.3:2e8ac93a: core: check logging protection before the level

Daniel-Constantin Mierla miconda at gmail.com
Wed Jan 22 09:54:21 CET 2020


Module: kamailio
Branch: 5.3
Commit: 2e8ac93a2c21b9087d60903a406c4cccfe129b86
URL: https://github.com/kamailio/kamailio/commit/2e8ac93a2c21b9087d60903a406c4cccfe129b86

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-01-22T09:42:58+01:00

core: check logging protection before the level

(cherry picked from commit 53ca8b50207ca35f16a2315efb1ed29448961da8)

---

Modified: src/core/dprint.h

---

Diff:  https://github.com/kamailio/kamailio/commit/2e8ac93a2c21b9087d60903a406c4cccfe129b86.diff
Patch: https://github.com/kamailio/kamailio/commit/2e8ac93a2c21b9087d60903a406c4cccfe129b86.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