fix a crash in case of trace issued by the SIP publish

This commit is contained in:
Jehan Monnier 2015-06-05 11:01:36 +02:00
parent be2b046a17
commit aedf7bfa4a

View file

@ -529,24 +529,13 @@ void linphone_iphone_log_handler(int lev, const char *fmt, va_list args){
NSString* format = [[NSString alloc] initWithUTF8String:fmt];
NSString* formatedString = [[NSString alloc] initWithFormat:format arguments:args];
//since \r are interpreted like \n, avoid double new lines when logging packets
NSLogv([formatedString stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"], nil);
NSLog([formatedString stringByReplacingOccurrencesOfString:@"\r\n" withString:@"\n"], nil);
}
//Error/warning log handler
static void linphone_iphone_log(struct _LinphoneCore * lc, const char * message) {
NSString* log = [NSString stringWithCString:message encoding:[NSString defaultCStringEncoding]];
NSLog(log, NULL);
// dispatch_async(dispatch_get_main_queue(), ^{
// if([[LinphoneManager instance].logs count] >= LINPHONE_LOGS_MAX_ENTRY) {
// [[LinphoneManager instance].logs removeObjectAtIndex:0];
// }
// [[LinphoneManager instance].logs addObject:log];
//
// // Post event
// NSDictionary *dict = [NSDictionary dictionaryWithObject:log forKey:@"log"];
// [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneLogsUpdate object:[LinphoneManager instance] userInfo:dict];
// });
}