summaryrefslogtreecommitdiff
path: root/main/libasteriskpj.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-11-23 18:27:54 -0600
committerRichard Mudgett <rmudgett@digium.com>2016-11-30 13:11:48 -0600
commit1dfa11b65cd3bd768605eb7779214e4330f52ed3 (patch)
tree7ff2db3895e43802070509ba0b7cf8b3229065dd /main/libasteriskpj.c
parenta0c0b1c9cb01db6b1b968efc01ff43a7f492795e (diff)
PJPROJECT logging: Made easier to get available logging levels.
Use of the new logging is as simple as issuing the new CLI command or setting the new pjproject.conf option. Other options that can affect the logging are how you have the pjproject log levels mapped to Asterisk log types in pjproject.conf and if you have configured Asterisk to log the DEBUG type messages. Altering the pjproject.conf level mapping shouldn't be necessary for most installations as the default mapping is sensible. Configuring Asterisk to log the DEBUG message type is standard practice for collecting debug information. * Added CLI "pjproject set log level" command to dynamically adjust the maximum pjproject log message level. * Added CLI "pjproject show log level" command to see the currently set maximum pjproject log message level. * Added pjproject.conf startup section "log_level" option to set the initial maximum pjproject log message level so all messages could be captured from initialization. * Set PJ_LOG_MAX_LEVEL to 6 to compile in all defined logging levels into bundled pjproject. Pjproject will use the currently set run time log level to determine if a log message is generated just like Asterisk verbose and debug logging levels. * In log_forwarder(), made always log enabled and mapped pjproject log messages. DEBUG mapped log messages are no longer gated by the current Asterisk debug logging level. * Removed RAII_VAR() from res_pjproject.c:get_log_level(). ASTERISK-26630 #close Change-Id: I6dca12979f482ffb0450aaf58db0fe0f6d2e5389
Diffstat (limited to 'main/libasteriskpj.c')
-rw-r--r--main/libasteriskpj.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/libasteriskpj.c b/main/libasteriskpj.c
index 22660e686..0f893a2cf 100644
--- a/main/libasteriskpj.c
+++ b/main/libasteriskpj.c
@@ -35,6 +35,7 @@
#include <pjlib.h>
#endif
+#include "asterisk/options.h"
#include "asterisk/_private.h" /* ast_pj_init() */
/*!
@@ -44,6 +45,7 @@
int ast_pj_init(void)
{
#ifdef HAVE_PJPROJECT_BUNDLED
+ pj_log_set_level(ast_option_pjproject_log_level);
pj_init();
#endif
return 0;