Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #22 from zhangshsy/master

fix issue CLOUDSRV-1466 ios SDK should have an easy option to disable console log
  • Loading branch information...
commit 7aa9415de0f4d524c9423fe1d0b0b4433e1cfd5c 2 parents 8e89774 + 3d141c1
@baobeimm baobeimm authored
View
14 Readme.mdown
@@ -110,4 +110,18 @@ to yourappDelegate.m
Don't forget to edit your app-info.plist to add URL types for your facebook id. See facebook ios sdk for more information.
+-----
+Enable/Disable runtime log
+You can enable/disable runtime log by set loggingEnabled variable in Cocoafish.m :
+
+-(void)initCommon:(NSDictionary *)customAppIds
+{
+ //other code
+ //true, enable log
+ //false, disable log
+ self.loggingEnabled = true;
+
+ // other code
+}
+
With the Cocoafish IOS SDK, you can perform all the actions described in http://cocoafish.com/docs/quickstart
View
4 samples/DemoApp/Classes/CheckinViewController.m
@@ -127,9 +127,9 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking
/*// Write the image to the photo album if we took it with the camera
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) {
- NSLog(@"Start saving fullsize image to the camera roll");
+ CCLog(@"Start saving fullsize image to the camera roll");
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
- NSLog(@"End saving fullsize image to the camera roll");
+ CCLog(@"End saving fullsize image to the camera roll");
}*/
[self preparePhoto:image];
View
6 samples/DemoApp/Classes/LoginViewController.m
@@ -308,7 +308,7 @@ - (void)startLogin
-(void)registerSucceeded
{
- NSLog(@"Register controller succeeded now we're in login controller");
+ CCLog(@"Register controller succeeded now we're in login controller");
// call the delegate's method
[self.delegate loginSucceeded];
@@ -319,14 +319,14 @@ -(void)registerSucceeded
-(void)registerFailed
{
- NSLog(@"Register controller failed");
+ CCLog(@"Register controller failed");
}
#pragma -
#pragma mark CCFBSessionDelegate methods
-(void)fbDidLogin
{
- NSLog(@"fbDidLogin");
+ CCLog(@"fbDidLogin");
// call the delegate's method
[self.navigationController popViewControllerAnimated:NO];
View
2  samples/DemoApp/Classes/UserController.m
@@ -300,7 +300,7 @@ - (void)dealloc {
#pragma mark CCFBSessionDelegate methods
-(void)fbDidLogin
{
- NSLog(@"fbDidLogin");
+ CCLog(@"fbDidLogin");
UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithTitle:@"Unlink Facebook" style:UIBarButtonItemStylePlain target:self action:@selector(unlinkFromFacebook)];
self.navigationItem.leftBarButtonItem = button;
[button release];
View
4 src/Cocoafish/Cache/CCDownloadManager.m
@@ -297,7 +297,7 @@ -(void)cleanupCache
NSError* error = nil;
NSArray* filesArray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:[Cocoafish defaultCocoafish].cocoafishDir error:&error];
if(error != nil) {
- NSLog(@"Error in reading files: %@", [error localizedDescription]);
+ CCLog(@"Error in reading files: %@", [error localizedDescription]);
return;
}
if ([filesArray count] == 0) {
@@ -369,7 +369,7 @@ -(void)cleanupCache
break;
}
if ([[NSFileManager defaultManager] removeItemAtPath:[file objectForKey:@"path"] error:&error] != YES) {
- NSLog(@"Unable to delete file: %@", [error localizedDescription]);
+ CCLog(@"Unable to delete file: %@", [error localizedDescription]);
continue;
}
fileSize -= [[file objectForKey:@"size"] unsignedLongLongValue];
View
6 src/Cocoafish/Cocoafish.m
@@ -92,7 +92,7 @@ -(void)initCommon:(NSDictionary *)customAppIds
//[self cleanupCacheDir];
if (![[NSFileManager defaultManager] createDirectoryAtPath:_cocoafishDir withIntermediateDirectories:NO attributes:nil error:nil]) {
- NSLog(@"Failed to create %@, photo download will not work", _cocoafishDir);
+ CCLog(@"Failed to create %@, photo download will not work", _cocoafishDir);
}
_downloadManager = [[CCDownloadManager alloc] init];
@@ -103,7 +103,7 @@ -(void)initCommon:(NSDictionary *)customAppIds
if (customAppId != nil) {
_facebook = [[Facebook alloc] initWithAppId:customAppId andDelegate:self];
_facebookAppId = [customAppId copy];
- NSLog(@"Cocoafish: initialized facebook with app Id %@", customAppId);
+ CCLog(@"Cocoafish: initialized facebook with app Id %@", customAppId);
}
}
@@ -301,7 +301,7 @@ -(void)saveUserSession
// debug
if ([[Cocoafish defaultCocoafish] loggingEnabled]) {
- NSLog(@"Storing cookies into file %@", cookieDataPath);
+ CCLog(@"Storing cookies into file %@", cookieDataPath);
}
NSHTTPCookieStorage* sharedCookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
View
4 src/Cocoafish/Models/CCCheckin.m
@@ -37,13 +37,13 @@ -(id)initWithJsonResponse:(NSDictionary *)jsonResponse
_event = [[CCEvent alloc] initWithJsonResponse:[jsonResponse objectForKey:@"event"]];
}
@catch (NSException *e) {
- NSLog(@"Error: Failed to parse checkin object. Reason: %@", [e reason]);
+ CCLog(@"Error: Failed to parse checkin object. Reason: %@", [e reason]);
[self release];
self = nil;
return self;
}
if (self.user == nil || self.place == nil) {
- NSLog(@"invalid checkin object from server: %@", jsonResponse);
+ CCLog(@"invalid checkin object from server: %@", jsonResponse);
[self release];
self = nil;
return self;
View
4 src/Cocoafish/Models/CCEvent.m
@@ -65,7 +65,7 @@ -(id)initWithJsonResponse:(NSDictionary *)jsonResponse
}
@catch (NSException *e) {
- NSLog(@"Error: Failed to parse Event object. Reason: %@", [e reason]);
+ CCLog(@"Error: Failed to parse Event object. Reason: %@", [e reason]);
[self release];
self = nil;
}
@@ -140,7 +140,7 @@ -(id)initWithJsonResponse:(NSDictionary *)jsonResponse
}
@catch (NSException *e) {
- NSLog(@"Error: Failed to parse EventOccurrence object. Reason: %@", [e reason]);
+ CCLog(@"Error: Failed to parse EventOccurrence object. Reason: %@", [e reason]);
[self release];
self = nil;
}
View
2  src/Cocoafish/Models/CCMessage.m
@@ -49,7 +49,7 @@ -(id)initWithJsonResponse:(NSDictionary *)jsonResponse
}
}
@catch (NSException *e) {
- NSLog(@"Error: Failed to parse Message object. Reason: %@", [e reason]);
+ CCLog(@"Error: Failed to parse Message object. Reason: %@", [e reason]);
[self release];
self = nil;
}
View
2  src/Cocoafish/Models/CCPost.m
@@ -39,7 +39,7 @@ -(id)initWithJsonResponse:(NSDictionary *)jsonResponse
_user = [[CCUser alloc] initWithJsonResponse:[jsonResponse objectForKey:CC_JSON_USER]];
}
@catch (NSException *e) {
- NSLog(@"Error: Failed to parse Post object. Reason: %@", [e reason]);
+ CCLog(@"Error: Failed to parse Post object. Reason: %@", [e reason]);
[self release];
self = nil;
}
View
2  src/Cocoafish/Models/CCReview.m
@@ -30,7 +30,7 @@ -(id)initWithJsonResponse:(NSDictionary *)jsonResponse
_user = [[CCUser alloc] initWithJsonResponse:[jsonResponse objectForKey:CC_JSON_USER]];
}
@catch (NSException *e) {
- NSLog(@"Error: Failed to parse Review object. Reason: %@", [e reason]);
+ CCLog(@"Error: Failed to parse Review object. Reason: %@", [e reason]);
[self release];
self = nil;
}
View
2  src/Cocoafish/Models/CCUser.m
@@ -52,7 +52,7 @@ -(id)initWithJsonResponse:(NSDictionary *)jsonResponse
self.externalAccounts = [CCPhoto arrayWithJsonResponse:jsonResponse class:[CCExternalAccount class]];
/* if (self.firstName == nil && self.lastName == nil && self.username == nil) {
- NSLog(@"Invalid user object from server: %@", jsonResponse);
+ CCLog(@"Invalid user object from server: %@", jsonResponse);
[self release];
self = nil;
return self;
View
2  src/Cocoafish/Network/CCRequest.m
@@ -347,7 +347,7 @@ - (NSData *)imageDataFromALAsset:(ALAsset *)alasset {
if (gotByteCount) {
if (err) {
- NSLog(@"!!! Error reading asset: %@", [err localizedDescription]);
+ CCLog(@"!!! Error reading asset: %@", [err localizedDescription]);
[err release];
free(buff);
return nil;
View
4 src/Cocoafish/Network/CCResponse.m
@@ -66,7 +66,7 @@ -(id)initWithJsonResponse:(NSDictionary *)jsonResponse
}
// Sanity check
if (_meta == nil) {
- NSLog(@"No meta data found in response");
+ CCLog(@"No meta data found in response");
[self release];
self = nil;
}
@@ -91,7 +91,7 @@ -(id)initWithJsonData:(NSData *)jsonData
}
@catch (NSException *exception) {
// Failed to parse
- NSLog(@"Failed to parse data using YAJL JSON parser. Reason: %@", exception.reason);
+ CCLog(@"Failed to parse data using YAJL JSON parser. Reason: %@", exception.reason);
}
return nil;
}
Please sign in to comment.
Something went wrong with that request. Please try again.