avoid log handler removal in case of subsequence call to linphone_core_set_log_handler

This commit is contained in:
Jehan Monnier 2015-02-11 17:50:08 +01:00
parent 7942e7e60a
commit d107a069ed

View file

@ -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();
}