summaryrefslogtreecommitdiff
path: root/include/asterisk/options.h
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 /include/asterisk/options.h
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 'include/asterisk/options.h')
-rw-r--r--include/asterisk/options.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/asterisk/options.h b/include/asterisk/options.h
index 345bacf6c..ff35c16c4 100644
--- a/include/asterisk/options.h
+++ b/include/asterisk/options.h
@@ -132,6 +132,20 @@ enum ast_option_flags {
#define ast_opt_generic_plc ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC)
#define ast_opt_ref_debug ast_test_flag(&ast_options, AST_OPT_FLAG_REF_DEBUG)
+/*! Maximum log level defined by PJPROJECT. */
+#define MAX_PJ_LOG_MAX_LEVEL 6
+/*!
+ * Normal PJPROJECT active log level used by Asterisk.
+ *
+ * These levels are usually mapped to Error and
+ * Warning Asterisk log levels which shouldn't
+ * normally be suppressed.
+ */
+#define DEFAULT_PJ_LOG_MAX_LEVEL 2
+
+/*! Current pjproject logging level */
+extern int ast_option_pjproject_log_level;
+
extern struct ast_flags ast_options;
extern int option_verbose;