From d107a069ede8c5c4d49ea75e2180af5911ae52bf Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 11 Feb 2015 17:50:08 +0100 Subject: [PATCH] avoid log handler removal in case of subsequence call to linphone_core_set_log_handler --- coreapi/linphonecore.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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(); }