Utils.m: rename logger helper functions to LOGx instead of Linphone_x

This commit is contained in:
Gautier Pelloux-Prayer 2015-04-15 12:51:33 +02:00
parent d79364150b
commit 9fcd50e031
8 changed files with 30 additions and 31 deletions

View file

@ -279,7 +279,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe
CFTypeRef values[] = { [value copy], [LinphoneManager instance].contactSipField };
CFDictionaryRef lDict = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, NULL, NULL);
if (entry) {
index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]);
index = (int)ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]);
ABMultiValueReplaceValueAtIndex(lMap, lDict, index);
} else {
CFStringRef label = (CFStringRef)[labelArray objectAtIndex:0];
@ -300,7 +300,7 @@ static const ContactSections_e contactSections[ContactSections_MAX] = {ContactSe
lcMap = ABRecordCopyValue(contact, kABPersonInstantMessageProperty);
lMap = ABMultiValueCreateMutableCopy(lcMap);
CFRelease(lcMap);
index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]);
index = (int)ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]);
lDict = ABMultiValueCopyValueAtIndex(lMap,index);
if(!CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) {
/*too bad probably a gtalk number, storing uri*/

View file

@ -289,7 +289,7 @@ static UICompositeViewDescription *compositeDescription = nil;
if( attachLogs ){
char * filepath = linphone_core_compress_log_collection([LinphoneManager getLc]);
if (filepath == NULL) {
Linphone_err(@"Cannot sent logs: file is NULL");
LOGE(@"Cannot sent logs: file is NULL");
return;
}
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
@ -300,7 +300,7 @@ static UICompositeViewDescription *compositeDescription = nil;
mimeType = @"application/gzip";
filename = [appName stringByAppendingString:@".gz"];
} else {
Linphone_err(@"Unknown extension type: %@, cancelling email", filename);
LOGE(@"Unknown extension type: %@, cancelling email", filename);
return;
}
[controller setMessageBody:NSLocalizedString(@"Application logs", nil) isHTML:NO];

View file

@ -54,12 +54,12 @@
- (void)applicationDidEnterBackground:(UIApplication *)application{
Linphone_log(@"%@", NSStringFromSelector(_cmd));
LOGI(@"%@", NSStringFromSelector(_cmd));
[[LinphoneManager instance] enterBackgroundMode];
}
- (void)applicationWillResignActive:(UIApplication *)application {
Linphone_log(@"%@", NSStringFromSelector(_cmd));
LOGI(@"%@", NSStringFromSelector(_cmd));
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneCall* call = linphone_core_get_current_call(lc);
@ -82,7 +82,7 @@
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
Linphone_log(@"%@", NSStringFromSelector(_cmd));
LOGI(@"%@", NSStringFromSelector(_cmd));
if( startedInBackground ){
startedInBackground = FALSE;
@ -232,7 +232,7 @@
}
- (void)applicationWillTerminate:(UIApplication *)application {
Linphone_log(@"%@", NSStringFromSelector(_cmd));
LOGI(@"%@", NSStringFromSelector(_cmd));
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
@ -311,7 +311,7 @@
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
Linphone_log(@"%@ : %@", NSStringFromSelector(_cmd), userInfo);
LOGI(@"%@ : %@", NSStringFromSelector(_cmd), userInfo);
[self processRemoteNotification:userInfo];
}
@ -331,7 +331,7 @@
}
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
Linphone_log(@"%@ - state = %ld", NSStringFromSelector(_cmd), (long)application.applicationState);
LOGI(@"%@ - state = %ld", NSStringFromSelector(_cmd), (long)application.applicationState);
[self fixRing];
@ -370,7 +370,7 @@
// this method is implemented for iOS7. It is invoked when receiving a push notification for a call and it has "content-available" in the aps section.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
Linphone_log(@"%@ : %@", NSStringFromSelector(_cmd), userInfo);
LOGI(@"%@ : %@", NSStringFromSelector(_cmd), userInfo);
LinphoneManager* lm = [LinphoneManager instance];
// save the completion handler for later execution.
@ -394,23 +394,23 @@
#pragma mark - PushNotification Functions
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken {
Linphone_log(@"%@ : %@", NSStringFromSelector(_cmd), deviceToken);
LOGI(@"%@ : %@", NSStringFromSelector(_cmd), deviceToken);
[[LinphoneManager instance] setPushNotificationToken:deviceToken];
}
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error {
Linphone_log(@"%@ : %@", NSStringFromSelector(_cmd), [error localizedDescription]);
LOGI(@"%@ : %@", NSStringFromSelector(_cmd), [error localizedDescription]);
[[LinphoneManager instance] setPushNotificationToken:nil];
}
#pragma mark - User notifications
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
Linphone_log(@"%@", NSStringFromSelector(_cmd));
LOGI(@"%@", NSStringFromSelector(_cmd));
}
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification completionHandler:(void (^)())completionHandler {
Linphone_log(@"%@", NSStringFromSelector(_cmd));
LOGI(@"%@", NSStringFromSelector(_cmd));
if( [[UIDevice currentDevice].systemVersion floatValue] >= 8){
LinphoneCore* lc = [LinphoneManager getLc];
@ -441,7 +441,7 @@
}
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler {
Linphone_log(@"%@", NSStringFromSelector(_cmd));
LOGI(@"%@", NSStringFromSelector(_cmd));
completionHandler();
}

View file

@ -178,12 +178,12 @@
// if we start in portrait, the landscape view must get the opposite height and width
if( portrait || [[UIDevice currentDevice].systemVersion floatValue] < 8 ){
Linphone_log(@"landscape get opposite: %@", NSStringFromCGSize(oppositeFrame.size));
LOGI(@"landscape get opposite: %@", NSStringFromCGSize(oppositeFrame.size));
[landscapeView setFrame:oppositeFrame];
} else {
// if we start in landscape, the landscape view has to get the current size,
// whereas the portrait has to get the opposite
Linphone_log(@"landscape get frame: %@ and portrait gets opposite: %@", NSStringFromCGSize(frame.size), NSStringFromCGSize(oppositeFrame.size));
LOGI(@"landscape get frame: %@ and portrait gets opposite: %@", NSStringFromCGSize(frame.size), NSStringFromCGSize(oppositeFrame.size));
[landscapeView setFrame:frame];
[portraitView setFrame:oppositeFrame];
}

View file

@ -75,7 +75,7 @@ static RootViewManager* rootViewManagerInstance = nil;
UIInterfaceOrientation nextViewOrientation = newMainView.interfaceOrientation;
UIInterfaceOrientation previousOrientation = currentViewController.interfaceOrientation;
Linphone_log(@"Changing rootViewController: %@ -> %@", currentViewController.name, newMainView.name);
LOGI(@"Changing rootViewController: %@ -> %@", currentViewController.name, newMainView.name);
currentViewController = newMainView;
LinphoneAppDelegate* delegate = (LinphoneAppDelegate*)[UIApplication sharedApplication].delegate;

View file

@ -165,7 +165,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf
if( addressBook != nil ){
NSError* err = nil;
if( !ABAddressBookSave(addressBook, (CFErrorRef*)err) ){
Linphone_warn(@"Couldn't save Address Book");
LOGW(@"Couldn't save Address Book");
}
}
}

View file

@ -62,12 +62,11 @@ typedef enum _LinphoneLoggerSeverity {
@end
void Linphone_log(NSString* format, ...) NS_FORMAT_FUNCTION(1,2);
void Linphone_dbg(NSString* format, ...) NS_FORMAT_FUNCTION(1,2);
void Linphone_warn(NSString* format, ...) NS_FORMAT_FUNCTION(1,2);
void Linphone_err(NSString* format, ...) NS_FORMAT_FUNCTION(1,2);
void Linphone_fatal(NSString* format, ...) NS_FORMAT_FUNCTION(1,2);
void LOGI(NSString* format, ...) NS_FORMAT_FUNCTION(1,2);
void LOGD(NSString* format, ...) NS_FORMAT_FUNCTION(1,2);
void LOGW(NSString* format, ...) NS_FORMAT_FUNCTION(1,2);
void LOGE(NSString* format, ...) NS_FORMAT_FUNCTION(1,2);
void LOGF(NSString* format, ...) NS_FORMAT_FUNCTION(1,2);
#endif

View file

@ -253,22 +253,22 @@
[LinphoneLogger logv:level format:argstart args:args]; \
va_end(args);
void Linphone_log(NSString* format, ...){
void LOGI(NSString* format, ...){
LOGV(LinphoneLoggerLog, format);
}
void Linphone_dbg(NSString* format, ...){
void LOGD(NSString* format, ...){
LOGV(LinphoneLoggerDebug, format);
}
void Linphone_warn(NSString* format, ...){
void LOGW(NSString* format, ...){
LOGV(LinphoneLoggerWarning, format);
}
void Linphone_err(NSString* format, ...){
void LOGE(NSString* format, ...){
LOGV(LinphoneLoggerError, format);
}
void Linphone_fatal(NSString* format, ...){
void LOGF(NSString* format, ...){
LOGV(LinphoneLoggerFatal, format);
}