mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
LinphoneManager.m: do not display an empty line between each line of received/sent packets because of \r\n, but instead replace \r\n seqeuence with \n before logging
This commit is contained in:
parent
4a05213af1
commit
f2d929c46d
1 changed files with 4 additions and 16 deletions
|
|
@ -525,23 +525,11 @@ static void dump_section(const char* section, void* data){
|
|||
|
||||
#pragma mark - Logs Functions
|
||||
|
||||
//generic log handler for debug version
|
||||
void linphone_iphone_log_handler(int lev, const char *fmt, va_list args){
|
||||
NSString* format = [[NSString alloc] initWithUTF8String:fmt];
|
||||
NSLogv(format, args);
|
||||
// NSString* formatedString = [[NSString alloc] initWithFormat:format arguments:args];
|
||||
//
|
||||
// dispatch_async(dispatch_get_main_queue(), ^{
|
||||
// if([[LinphoneManager instance].logs count] >= LINPHONE_LOGS_MAX_ENTRY) {
|
||||
// [[LinphoneManager instance].logs removeObjectAtIndex:0];
|
||||
// }
|
||||
// [[LinphoneManager instance].logs addObject:formatedString];
|
||||
//
|
||||
// // Post event
|
||||
// NSDictionary *dict = [NSDictionary dictionaryWithObject:formatedString forKey:@"log"];
|
||||
// [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneLogsUpdate object:[LinphoneManager instance] userInfo:dict];
|
||||
// });
|
||||
//
|
||||
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);
|
||||
}
|
||||
|
||||
//Error/warning log handler
|
||||
|
|
@ -1922,7 +1910,7 @@ static void audioRouteChangeListenerCallback (
|
|||
if (call) {
|
||||
// The LinphoneCallAppData object should be set on call creation with callback
|
||||
// - (void)onCall:StateChanged:withMessage:. If not, we are in big trouble and expect it to crash
|
||||
// We are NOT responsible for creating the AppData.
|
||||
// We are NOT responsible for creating the AppData.
|
||||
LinphoneCallAppData* data=(__bridge LinphoneCallAppData*)linphone_call_get_user_data(call);
|
||||
if (data==nil)
|
||||
LOGE(@"New call instanciated but app data was not set. Expect it to crash.");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue