[Asterisk-code-review] pjproject bundled: Fix setting lax log level (asterisk[master])

George Joseph asteriskteam at digium.com
Mon Jan 23 09:16:19 CST 2017


George Joseph has uploaded a new change for review. ( https://gerrit.asterisk.org/4762 )

Change subject: pjproject_bundled: Fix setting lax log level
......................................................................

pjproject_bundled: Fix setting lax log level

An earlier attempt to prevent pjsua from spitting out an extra 6795
lines of debug output every time the testsuite called it was also
turning off the ability for asterisk to output debug info when it
needed to.  This patch reverts the earlier fix and instead adds
a pjproject patch that sets the startup log level to 1 for pjsua
pjsystest and the pjsua python binding.  This is an asterisk-only
patch that does not affect pjproject functionality and will not be
submitted upstream.

Change-Id: I347a8b58b2626f2906ccfc1d339e907627a0c9e8
---
M third-party/pjproject/Makefile
A third-party/pjproject/patches/0000-set_apps_initial_log_level.patch
2 files changed, 39 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/62/4762/1

diff --git a/third-party/pjproject/Makefile b/third-party/pjproject/Makefile
index 2398ec4..bfd1c27 100644
--- a/third-party/pjproject/Makefile
+++ b/third-party/pjproject/Makefile
@@ -187,13 +187,11 @@
 	$(CMD_PREFIX) ar qs $@ $< >/dev/null 2>&1
 
 $(apps): APP = $(filter pj%,$(subst -, ,$(notdir $@)))
-$(apps): CFLAGS += -DPJ_LOG_MAX_LEVEL=2
 $(apps): LDFLAGS += $(MALLOC_DEBUG_LDFLAGS)
 $(apps): $(MALLOC_DEBUG_LIBS) pjproject.symbols $(APP_THIRD_PARTY_LIB_FILES)
 	$(ECHO_PREFIX) Compiling $(APP)
 	$(CMD_PREFIX) +$(MAKE) -C source/pjsip-apps/build $(filter pj%,$(subst -, ,$(notdir $@))) $(REALLY_QUIET)
 
-source/pjsip-apps/src/python/_pjsua.o: CFLAGS += -DPJ_LOG_MAX_LEVEL=2
 source/pjsip-apps/src/python/_pjsua.o: source/pjsip-apps/src/python/_pjsua.c $(apps)
 	$(ECHO_PREFIX) Compiling python bindings
 	$(CMD_PREFIX) $(CC) -o $@ -c $< $(PYTHONDEV_INCLUDE) $(CFLAGS) $(PJ_CFLAGS)
diff --git a/third-party/pjproject/patches/0000-set_apps_initial_log_level.patch b/third-party/pjproject/patches/0000-set_apps_initial_log_level.patch
new file mode 100644
index 0000000..fc0f570
--- /dev/null
+++ b/third-party/pjproject/patches/0000-set_apps_initial_log_level.patch
@@ -0,0 +1,39 @@
+diff --git a/pjsip-apps/src/pjsua/main.c b/pjsip-apps/src/pjsua/main.c
+index 2baaf82..11831f2 100644
+--- a/pjsip-apps/src/pjsua/main.c
++++ b/pjsip-apps/src/pjsua/main.c
+@@ -126,5 +126,7 @@ int main_func(int argc, char *argv[])
+ 
+ int main(int argc, char *argv[])
+ {
++    pj_log_set_level(1);
++
+     return pj_run_app(&main_func, argc, argv, 0);
+ }
+diff --git a/pjsip-apps/src/pjsystest/main_console.c b/pjsip-apps/src/pjsystest/main_console.c
+index 122cdc7..dc79eab 100644
+--- a/pjsip-apps/src/pjsystest/main_console.c
++++ b/pjsip-apps/src/pjsystest/main_console.c
+@@ -133,6 +133,8 @@ void gui_sleep(unsigned sec)
+ 
+ int main()
+ {
++    pj_log_set_level(1);
++
+     if (systest_init() != PJ_SUCCESS)
+ 	return 1;
+ 
+diff --git a/pjsip-apps/src/python/_pjsua.c b/pjsip-apps/src/python/_pjsua.c
+index fb80e23..c9b21d8 100644
+--- a/pjsip-apps/src/python/_pjsua.c
++++ b/pjsip-apps/src/python/_pjsua.c
+@@ -4437,7 +4437,8 @@ init_pjsua(void)
+     PyObject* m = NULL;
+ #define ADD_CONSTANT(mod,name)	PyModule_AddIntConstant(mod,#name,name)
+ 
+-    
++    pj_log_set_level(1);
++
+     PyEval_InitThreads();
+ 
+     if (PyType_Ready(&PyTyp_pjsua_callback) < 0)

-- 
To view, visit https://gerrit.asterisk.org/4762
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I347a8b58b2626f2906ccfc1d339e907627a0c9e8
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: George Joseph <gjoseph at digium.com>



More information about the asterisk-code-review mailing list