Commit d6089010 authored by Ghislain MARY's avatar Ghislain MARY

Add API to reset the log collection.

parent 672b8336
......@@ -516,6 +516,19 @@ char * linphone_core_compress_log_collection(LinphoneCore *core) {
return ms_strdup_printf("%s/%s", liblinphone_log_collection_path ? liblinphone_log_collection_path : ".", COMPRESSED_LOG_COLLECTION_FILENAME);
}
void linphone_core_reset_log_collection(LinphoneCore *core) {
char *filename;
ortp_mutex_lock(&liblinphone_log_collection_mutex);
delete_log_collection_upload_file();
filename = ms_strdup_printf("%s/%s", liblinphone_log_collection_path ? liblinphone_log_collection_path : ".", "linphone1.log");
unlink(filename);
ms_free(filename);
filename = ms_strdup_printf("%s/%s", liblinphone_log_collection_path ? liblinphone_log_collection_path : ".", "linphone2.log");
unlink(filename);
ms_free(filename);
ortp_mutex_unlock(&liblinphone_log_collection_mutex);
}
/**
* Enable logs in supplied FILE*.
*
......
......@@ -1817,6 +1817,13 @@ LINPHONE_PUBLIC void linphone_core_upload_log_collection(LinphoneCore *core);
*/
LINPHONE_PUBLIC char * linphone_core_compress_log_collection(LinphoneCore *core);
/**
* Reset the log collection by removing the log files.
* @ingroup misc
* @param[in] core LinphoneCore object
*/
LINPHONE_PUBLIC void linphone_core_reset_log_collection(LinphoneCore *core);
/**
* Define a log handler.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment