mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
settings: fix log collection
This commit is contained in:
parent
523715edb9
commit
44a4d9b365
11 changed files with 14 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Reference in a new issue