mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 13:48:09 +00:00
Change API of linphone_core_enable_log_collection() to be able to deactivate the previous log handler.
This commit is contained in:
parent
62fd80b855
commit
ba815377f7
2 changed files with 15 additions and 5 deletions
|
|
@ -250,16 +250,20 @@ void linphone_core_set_log_collection_upload_server_url(LinphoneCore *core, cons
|
|||
lp_config_set_string(core->config, "misc", "log_collection_upload_server_url", server_url);
|
||||
}
|
||||
|
||||
void linphone_core_enable_log_collection(bool_t enable) {
|
||||
void linphone_core_enable_log_collection(LinphoneLogCollectionState state) {
|
||||
/* at first call of this function, set liblinphone_log_func to the current
|
||||
* ortp log function */
|
||||
if( liblinphone_log_func == NULL ){
|
||||
liblinphone_log_func = ortp_logv_out;
|
||||
}
|
||||
if ((enable == TRUE) && (liblinphone_log_collection_enabled == FALSE)) {
|
||||
if ((state != LinphoneLogCollectionDisabled) && (liblinphone_log_collection_enabled == FALSE)) {
|
||||
liblinphone_log_collection_enabled = TRUE;
|
||||
ortp_mutex_init(&liblinphone_log_collection_mutex, NULL);
|
||||
liblinphone_log_func = ortp_logv_out;
|
||||
if (state == LinphoneLogCollectionEnabledWithoutPreviousLogHandler) {
|
||||
liblinphone_log_func = NULL;
|
||||
} else {
|
||||
liblinphone_log_func = ortp_logv_out;
|
||||
}
|
||||
ortp_set_log_handler(linphone_core_log_collection_handler);
|
||||
} else {
|
||||
liblinphone_log_collection_enabled = FALSE;
|
||||
|
|
|
|||
|
|
@ -1780,12 +1780,18 @@ typedef void * (*LinphoneCoreWaitingCallback)(LinphoneCore *lc, void *context, L
|
|||
|
||||
/* THE main API */
|
||||
|
||||
typedef enum _LinphoneLogCollectionState {
|
||||
LinphoneLogCollectionDisabled,
|
||||
LinphoneLogCollectionEnabled,
|
||||
LinphoneLogCollectionEnabledWithoutPreviousLogHandler
|
||||
} LinphoneLogCollectionState;
|
||||
|
||||
/**
|
||||
* Enable the linphone core log collection to upload logs on a server.
|
||||
* @ingroup misc
|
||||
* @param[in] enable Boolean value telling whether to enable log collection or not.
|
||||
* @param[in] state LinphoneLogCollectionState value telling whether to enable log collection or not.
|
||||
*/
|
||||
LINPHONE_PUBLIC void linphone_core_enable_log_collection(bool_t enable);
|
||||
LINPHONE_PUBLIC void linphone_core_enable_log_collection(LinphoneLogCollectionState state);
|
||||
|
||||
/**
|
||||
* Set the path where the log files will be written for log collection.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue