diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index ffa2a6b32..91b3d060b 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -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(); }