Asterisk - The Open Source Telephony Project
18.5.0
|
#include "asterisk/logger.h"
Go to the source code of this file.
Macros | |
#define | ast_debug_category(sublevel, ids, ...) |
Log for a debug category. More... | |
#define | AST_LOG_CATEGORY_DISABLED 0 |
#define | AST_LOG_CATEGORY_ENABLED -1 |
Functions | |
char * | ast_debug_category_complete (const char *const *argv, int argc, const char *word, int state) |
Add a unique (no duplicates) result to a request for completion for debug categories. More... | |
int | ast_debug_category_is_allowed (int sublevel, uintmax_t ids) |
Check if a debug category is enabled, and allowed to output. More... | |
uintmax_t | ast_debug_category_register (const char *name) |
Register a debug level logger category. More... | |
int | ast_debug_category_set_sublevel (const char *name, int sublevel) |
Set the debug category's sublevel. More... | |
int | ast_debug_category_set_sublevels (const char *const *names, size_t size, int default_sublevel) |
Set one or more debug category's sublevel. More... | |
int | ast_debug_category_unregister (const char *name) |
Un-register a debug level logger category. More... | |
int | ast_logger_category_load (void) |
Load/Initialize system wide logger category functionality. More... | |
int | ast_logger_category_unload (void) |
Unload system wide logger category functionality. More... | |
#define ast_debug_category | ( | sublevel, | |
ids, | |||
... | |||
) |
Log for a debug category.
This will output log data for debug under the following conditions:
sublevel | The minimum level to output at |
ids | One or more unique category ids to output for |
Definition at line 171 of file logger_category.h.
Referenced by ast_rtp_ice_start_media(), and rtp_add_candidates_to_ice().
#define AST_LOG_CATEGORY_DISABLED 0 |
Logger category is disabled
Definition at line 31 of file logger_category.h.
Referenced by category_is_allowed(), category_register(), category_set_sublevel(), handle_cli_rtcp_set_debug(), handle_cli_rtp_set_debug(), handle_cli_stun_set_debug(), and handle_debug_category().
#define AST_LOG_CATEGORY_ENABLED -1 |
Logger category is enabled
Definition at line 26 of file logger_category.h.
Referenced by category_is_allowed(), handle_cli_rtcp_set_debug(), handle_cli_rtp_set_debug(), handle_cli_stun_set_debug(), handle_debug_category(), rtcp_do_debug_ip(), and rtp_do_debug_ip().
char* ast_debug_category_complete | ( | const char *const * | argv, |
int | argc, | ||
const char * | word, | ||
int | state | ||
) |
Add a unique (no duplicates) result to a request for completion for debug categories.
argv | A list of already completed options |
argc | The number of already completed options |
word | The word to complete |
state | The state |
0 | Success, -1 Failure |
Definition at line 300 of file logger_category.c.
References category_complete().
Referenced by handle_debug_category().
int ast_debug_category_is_allowed | ( | int | sublevel, |
uintmax_t | ids | ||
) |
Check if a debug category is enabled, and allowed to output.
sublevel | Current set sublevel must be this sublevel or less |
ids | One or more unique category ids to check |
1 | if allowed, 0 if not allowed |
Definition at line 306 of file logger_category.c.
References category_is_allowed().
uintmax_t ast_debug_category_register | ( | const char * | name | ) |
Register a debug level logger category.
name | The name of the category |
id | The unique id of the category |
0 | if failed to register/retrieve an id. Otherwise it returns the id for the registered category. |
Definition at line 279 of file logger_category.c.
References category_register().
Referenced by ast_rtp_engine_init(), and ast_stun_init().
int ast_debug_category_set_sublevel | ( | const char * | name, |
int | sublevel | ||
) |
Set the debug category's sublevel.
Statements are output at a specified sublevel. Typically any number greater than or equal to 0. Other acceptable values include AST_LOG_CATEGORY_ENABLED and AST_LOG_CATEGORY_DISABLED.
name | The name of the category |
sublevel | The debug sublevel output number |
0 | Success, -1 Failure |
Definition at line 289 of file logger_category.c.
References category_set_sublevel(), and NULL.
Referenced by handle_cli_rtcp_set_debug(), handle_cli_rtp_set_debug(), handle_cli_stun_set_debug(), rtcp_do_debug_ip(), and rtp_do_debug_ip().
int ast_debug_category_set_sublevels | ( | const char *const * | names, |
size_t | size, | ||
int | default_sublevel | ||
) |
Set one or more debug category's sublevel.
Accepts an array of category names, and optional associated sublevels. Sublevels can be associated with a name by using a ':' as a separator. For example:
<category name>="">:<category sublevel>="">
The given default sublevel is used if no sublevel is associated with a name.
names | An array of category names |
size | The size of the array (number of elements) |
default_sublevel | The sublevel value to use if one is not associated with a name |
0 | Success, -1 Failure |
Definition at line 294 of file logger_category.c.
References category_set_sublevels().
Referenced by handle_debug_category().
int ast_debug_category_unregister | ( | const char * | name | ) |
Un-register a debug level logger category.
0 | Success, -1 Failure |
Definition at line 284 of file logger_category.c.
References category_unregister().
Referenced by rtp_engine_shutdown(), and stun_shutdown().
int ast_logger_category_load | ( | void | ) |
Load/Initialize system wide logger category functionality.
0 | Success, -1 Failure |
Definition at line 317 of file logger_category.c.
References AST_VECTOR_RW_INIT, and categories_level_t::categories.
Referenced by init_logger().
int ast_logger_category_unload | ( | void | ) |
Unload system wide logger category functionality.
0 | Success, -1 Failure |
Definition at line 311 of file logger_category.c.
References AST_VECTOR_RW_FREE, and categories_level_t::categories.
Referenced by close_logger().