FS-11693 [core] Added switch_channel_set_log_tag() and switch_channel_get_log_tags() This allows you to add log tags to an active call channel. If using SWITCH_CHANNEL_SESSION_LOG, with switch_log_printf(), the tags will be added to the the log node so a logging module can send additional contextual data to a log aggregator.

This commit is contained in:
Chris Rienzo
2019-03-07 15:26:34 +00:00
committed by Chris Rienzo
parent 2e319c41c0
commit e4c0abf286
4 changed files with 50 additions and 0 deletions
+3
View File
@@ -270,6 +270,9 @@ SWITCH_DECLARE(char *) switch_channel_get_uuid(switch_channel_t *channel);
SWITCH_DECLARE(switch_status_t) switch_channel_set_profile_var(switch_channel_t *channel, const char *name, const char *val);
SWITCH_DECLARE(switch_status_t) switch_channel_set_log_tag(switch_channel_t *channel, const char *tagname, const char *tagvalue);
SWITCH_DECLARE(switch_status_t) switch_channel_get_log_tags(switch_channel_t *channel, switch_event_t **log_tags);
SWITCH_DECLARE(switch_status_t) switch_channel_set_variable_var_check(switch_channel_t *channel,
const char *varname, const char *value, switch_bool_t var_check);
SWITCH_DECLARE(switch_status_t) switch_channel_add_variable_var_check(switch_channel_t *channel,
+1
View File
@@ -65,6 +65,7 @@ SWITCH_BEGIN_EXTERN_C
/* To maintain abi, only add new elements to the end of this struct and do not delete any elements */
switch_text_channel_t channel;
switch_log_level_t slevel;
switch_event_t *tags;
} switch_log_node_t;
typedef switch_status_t (*switch_log_function_t) (const switch_log_node_t *node, switch_log_level_t level);