Commit d107a069 authored by jehan's avatar jehan
Browse files

avoid log handler removal in case of subsequence call to linphone_core_set_log_handler

parent 7942e7e6
......@@ -154,7 +154,11 @@ const LinphoneAddress *linphone_core_get_current_call_remote_address(struct _Lin
}
void linphone_core_set_log_handler(OrtpLogFunc logfunc) {
ortp_set_log_handler(logfunc);
if (ortp_logv_out == linphone_core_log_collection_handler) {
ms_message("There is already a log collection handler, keep it");
liblinphone_log_func = logfunc;
} else
ortp_set_log_handler(logfunc);
}
void linphone_core_set_log_file(FILE *file) {
......@@ -645,7 +649,7 @@ void linphone_core_enable_logs(FILE *file){
**/
void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc){
ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL);
ortp_set_log_handler(logfunc);
linphone_core_set_log_handler(logfunc);
sal_enable_logs();
}
......
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