From 0c124c486e84ae1ebe194f410e440260e8477eba Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Fri, 24 Oct 2014 14:23:17 +0200 Subject: [PATCH] Fix logs disable when linphone_core_enable_log_collection is called with FALSE at app start --- coreapi/linphonecore.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index cac592107..03dd18c7f 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -173,7 +173,7 @@ static void linphone_core_log_collection_handler(OrtpLogLevel level, const char char *log_filename2; FILE *log_file; struct timeval tp; - struct tm *lt; + struct tm *lt; time_t tt; struct stat statbuf; @@ -251,6 +251,11 @@ void linphone_core_set_log_collection_upload_server_url(LinphoneCore *core, cons } void linphone_core_enable_log_collection(bool_t enable) { + /* at first call of this function, set liblinphone_log_func to the current + * ortp log function */ + if( liblinphone_log_func == NULL ){ + liblinphone_log_func = ortp_logv_out; + } if ((enable == TRUE) && (liblinphone_log_collection_enabled == FALSE)) { liblinphone_log_collection_enabled = TRUE; ortp_mutex_init(&liblinphone_log_collection_mutex, NULL);