From 44a4d9b3655edb9c6f9039ac4962c77bed7bf4f0 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 26 Jan 2016 14:32:25 +0100 Subject: [PATCH] settings: fix log collection --- Classes/SettingsView.m | 15 +++++++++++++-- Classes/Utils/Log.m | 2 +- Resources/ar.lproj/Localizable.strings | Bin 39206 -> 39718 bytes Resources/de.lproj/Localizable.strings | Bin 41042 -> 41554 bytes Resources/en.lproj/Localizable.strings | Bin 40030 -> 40542 bytes Resources/fr.lproj/Localizable.strings | Bin 41794 -> 42336 bytes Resources/ja.lproj/Localizable.strings | Bin 37154 -> 37666 bytes Resources/nl.lproj/Localizable.strings | Bin 40856 -> 41368 bytes Resources/ru.lproj/Localizable.strings | Bin 40248 -> 40760 bytes Resources/sv.lproj/Localizable.strings | Bin 40180 -> 40692 bytes Resources/zh_TW.lproj/Localizable.strings | Bin 39940 -> 40452 bytes 11 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Classes/SettingsView.m b/Classes/SettingsView.m index b94dd49b1..98cf47fe5 100644 --- a/Classes/SettingsView.m +++ b/Classes/SettingsView.m @@ -525,7 +525,9 @@ static UICompositeViewDescription *compositeDescription = nil; [hiddenKeys addObject:@"flush_images_button"]; #endif - if (![LinphoneManager.instance lpConfigBoolForKey:@"debugenable_preference"]) { + int debugLevel = [LinphoneManager.instance lpConfigIntForKey:@"debugenable_preference"]; + BOOL debugEnabled = (debugLevel >= ORTP_DEBUG && debugLevel < ORTP_ERROR); + if (!debugEnabled) { [hiddenKeys addObject:@"send_logs_button"]; [hiddenKeys addObject:@"reset_logs_button"]; } @@ -756,6 +758,7 @@ static UICompositeViewDescription *compositeDescription = nil; [attachments addObject:@[ [NSString stringWithUTF8String:filepath], mimeType, filename ]]; } } + ms_free(filepath); if ([LinphoneManager.instance lpConfigBoolForKey:@"send_logs_include_linphonerc_and_chathistory"]) { // retrieve linphone rc @@ -770,8 +773,16 @@ static UICompositeViewDescription *compositeDescription = nil; ]]; } + if (attachments.count == 0) { + DTAlertView *alert = [[DTAlertView alloc] + initWithTitle:NSLocalizedString(@"Cannot send logs", nil) + message:NSLocalizedString(@"Nothing could be collected from your application, aborting now.", nil)]; + [alert addCancelButtonWithTitle:NSLocalizedString(@"Cancel", nil) block:nil]; + [alert show]; + return; + } + [self emailAttachments:attachments]; - ms_free(filepath); } - (void)emailAttachments:(NSArray *)attachments { NSString *error = nil; diff --git a/Classes/Utils/Log.m b/Classes/Utils/Log.m index 7892d4eae..62239776e 100644 --- a/Classes/Utils/Log.m +++ b/Classes/Utils/Log.m @@ -52,8 +52,8 @@ + (void)enableLogs:(OrtpLogLevel)level { BOOL enabled = (level >= ORTP_DEBUG && level < ORTP_ERROR); linphone_core_set_log_collection_path([self cacheDirectory].UTF8String); - linphone_core_enable_log_collection(enabled); linphone_core_enable_logs_with_cb(linphone_iphone_log_handler); + linphone_core_enable_log_collection(enabled); if (level == 0) { linphone_core_set_log_level(ORTP_FATAL); ortp_set_log_level("ios", ORTP_FATAL); diff --git a/Resources/ar.lproj/Localizable.strings b/Resources/ar.lproj/Localizable.strings index ed540700fe5c2aa18ad76da0f57932691f5816e3..5d9c6834bb6fb0c6da3c54f3aa77231e2accb35c 100644 GIT binary patch delta 291 zcmZ3siD}t3rVT0*lcU7BCTHXcO=c721F_k281fm?8Hy(-%0y3oAi}d*MMB5Hxr8Bu zA(J5wD51cR3{+6cki(DyWG6ACLPc_bBB?;R5+DhZNn=nkD#7ZDChJa=tk(hZ z6M?$&fwCoV6Z3%lat1vHC7`S=5GyhG0Y#`_C)lP44Djh z4CxFC49N`n45bV?3@Jc%5<@CfBnK#x3Y04Wk|3Ehh9aQ4Tp+6wtiEWn;zY@O9Uwmu ws4E{RTLL#R56CZP&|^>n%Gv_45`!O5gi3Zw#6CfCg7n0&{GYjTgc1epEDC}MJgINxRwi5m{iB@7u1nGAUh z=?n@C$qe}nr3^U?DL{4-Ln>4x2Pl#Xlq&&}Ael6VBA~ilAgdCrzG!k|k7T|Mke>+D vl@F9Hft#2I=LSjH0 delta 19 bcmcb&hw0u9rVSzzo3}~aaM=7Ns>m4tV1o%* diff --git a/Resources/fr.lproj/Localizable.strings b/Resources/fr.lproj/Localizable.strings index 381c93859191bf95cb700dc8964ab71ad774b48d..4b706262aeccfe46c5d7b61848bb4d48d3517cbc 100644 GIT binary patch delta 235 zcmX?fjOoECrVUAwlU)`GO}?edHCaYXYVth^p~>$`(rVUQw?8OYJ40#MGlNFUjC*Kg|gY(ZDBu~~8;oIya-ev1t!jQp`2~?KO zpumvKkk3%cki(DyWG4YNLqu|bBB?;R5+DhZNn=nkD#7ZDCOdXX=Ia3Yi9lWX uK-m(wiFrVNIfEX95>VC_h?N-pfFe|~QyPz*lP@wxPi_cc*?cA>%mx6JBs|jq delta 19 bcmZ3qjA_v#rVUQwo1chx*={})7G?tgRxJp2 diff --git a/Resources/nl.lproj/Localizable.strings b/Resources/nl.lproj/Localizable.strings index 0a15e0a9763623a701c1ecf537c6e750dc7c3e31..08a828b2df57106e1efaa1bbfabff3dc78d2983e 100644 GIT binary patch delta 281 zcmbQSpJ~QnrVVuxjK!1R7D`Xf66IqrW=LhoV@R32uqb(Rfkc>-a|uHRLncrtok4*i znIWH{lp%*91;|bUDujsS07X)PawR|#B$LKa1XPy`WL1LI7ftS;AX%>iY$ Hs7o#YO?f|- delta 19 bcmbPnm}$m-rVVuxn-wHIoHieex#R)>Q{4z& diff --git a/Resources/ru.lproj/Localizable.strings b/Resources/ru.lproj/Localizable.strings index d076f7b66907d9bd84471734079576c88c834901..bb72bf4a6f6f9163cf7b876dee29323945abad6b 100644 GIT binary patch delta 285 zcmdn7i)qI`rVSkulldgLCjTnnVpU+UWl)%WQCu3xOPD-QjBj&?M1Z4n2}1@$CPN-W zI)eg3GDAK?DMJoJ3Xq+|kO~#a0g9vo$f^XZFPbbrN3vcA$WH|7 z$_L7pz)j2p^2-_Y7?gmrK2(EfeUr#L4<|IHmEpVX~uJ^yClW LESqmcCO88CtaL!2 delta 19 bcmdn7k7>s)rVSkuo3$hZ95>&HPH+YQSNsS~ diff --git a/Resources/sv.lproj/Localizable.strings b/Resources/sv.lproj/Localizable.strings index 941585af3d37ba45715461f06353e18ad58cbc22..5d343096a46392ae2837f9b3eca1800864cd0a93 100644 GIT binary patch delta 265 zcmeyelj+M|rVRlSlNX3{O%~x1nmkEdf;ERBpCNtnL%G<=2Sj-`2S{i*I+rkHFk~|1 zF{CpnFeC$|OBr$)Qh@9vhE%9X4p1Z&C|3d`K{9C!ML>1AKvpGKebMB`KFNF?AU_eP rD<3FZ0yi-a$S-HmV^9Lh+5)i>gC9_YN_I-)v2(JbS@h$f^XZF9Na>CvW5yt=9pufI9Pm zDoWs{<^lQT40;SoKv`QLR$}l2icra3h5{hW0os)ebi-b5PH8-DnA~U@J=q|HW%Hzn GB4+@W-awB4 delta 19 bcmZqK!_=~aX~QY;%{dY$95zpiDslz@SU?D+