Updated Branches: refs/heads/master 40de7408b -> 2979d14d7
[CB-1138] Default logging level for file access should not log file contents. Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/2979d14d Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/2979d14d Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/2979d14d Branch: refs/heads/master Commit: 2979d14d70d5f5e67d0c42b81afab76964cdf048 Parents: 40de740 Author: Shazron Abdullah <shaz...@apache.org> Authored: Thu Aug 9 16:42:41 2012 -0700 Committer: Shazron Abdullah <shaz...@apache.org> Committed: Thu Aug 9 16:42:56 2012 -0700 ---------------------------------------------------------------------- CordovaLib/Classes/CDVPluginResult.h | 3 ++- CordovaLib/Classes/CDVPluginResult.m | 27 ++++++++++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/2979d14d/CordovaLib/Classes/CDVPluginResult.h ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVPluginResult.h b/CordovaLib/Classes/CDVPluginResult.h index e6ed354..c2df23b 100644 --- a/CordovaLib/Classes/CDVPluginResult.h +++ b/CordovaLib/Classes/CDVPluginResult.h @@ -49,7 +49,8 @@ typedef enum { +(CDVPluginResult*) resultWithStatus: (CDVCommandStatus) statusOrdinal messageAsDictionary: (NSDictionary*) theMessage; +(CDVPluginResult*) resultWithStatus: (CDVCommandStatus) statusOrdinal messageToErrorObject: (int) errorCode; - ++(void) setVerbose:(BOOL)verbose; ++(BOOL) isVerbose; -(void) setKeepCallbackAsBool: (BOOL) bKeepCallback; http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/2979d14d/CordovaLib/Classes/CDVPluginResult.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVPluginResult.m b/CordovaLib/Classes/CDVPluginResult.m index cb786b7..8630a9c 100644 --- a/CordovaLib/Classes/CDVPluginResult.m +++ b/CordovaLib/Classes/CDVPluginResult.m @@ -111,7 +111,9 @@ static NSArray* org_apache_cordova_CommandStatusMsgs; self.keepCallback, @"keepCallback", nil] cdvjk_JSONString]; - DLog(@"PluginResult:toJSONString - %@", resultString); + if ([[self class] isVerbose]) { + NSLog(@"PluginResult:toJSONString - %@", resultString); + } return resultString; } @@ -119,7 +121,9 @@ static NSArray* org_apache_cordova_CommandStatusMsgs; { NSString* successCB = [NSString stringWithFormat:@"cordova.callbackSuccess('%@',%@);", callbackId, [self toJSONString]]; - DLog(@"PluginResult toSuccessCallbackString: %@", successCB); + if ([[self class] isVerbose]) { + NSLog(@"PluginResult toSuccessCallbackString: %@", successCB); + } return successCB; } @@ -127,9 +131,22 @@ static NSArray* org_apache_cordova_CommandStatusMsgs; { NSString* errorCB = [NSString stringWithFormat:@"cordova.callbackError('%@',%@);", callbackId, [self toJSONString]]; - - DLog(@"PluginResult toErrorCallbackString: %@", errorCB); + if ([[self class] isVerbose]) { + NSLog(@"PluginResult toErrorCallbackString: %@", errorCB); + } return errorCB; -} +} + +static BOOL gIsVerbose = NO; ++(void) setVerbose:(BOOL)verbose +{ + gIsVerbose = verbose; +} + ++(BOOL) isVerbose +{ + return gIsVerbose; +} + @end