diff options
author | Richard Mudgett <rmudgett@digium.com> | 2016-11-23 18:27:54 -0600 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2016-11-30 13:11:48 -0600 |
commit | 1dfa11b65cd3bd768605eb7779214e4330f52ed3 (patch) | |
tree | 7ff2db3895e43802070509ba0b7cf8b3229065dd /res/res_rtp_asterisk.c | |
parent | a0c0b1c9cb01db6b1b968efc01ff43a7f492795e (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 'res/res_rtp_asterisk.c')
-rw-r--r-- | res/res_rtp_asterisk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 4136f7e7b..58c217ecb 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -52,6 +52,7 @@ #include <ifaddrs.h> #endif +#include "asterisk/options.h" #include "asterisk/stun.h" #include "asterisk/pbx.h" #include "asterisk/frame.h" @@ -5665,6 +5666,7 @@ static int load_module(void) #ifdef HAVE_PJPROJECT pj_lock_t *lock; + pj_log_set_level(ast_option_pjproject_log_level); if (pj_init() != PJ_SUCCESS) { return AST_MODULE_LOAD_DECLINE; } |