Skip to content

Commit

Permalink
add disableLogging
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuswestin committed Apr 19, 2013
1 parent 9365d61 commit 5775ebb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions WebViewJavascriptBridge/WebViewJavascriptBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ typedef void (^WVJBHandler)(id data, WVJBResponseCallback responseCallback);
+ (id)bridgeForWebView:(UIWebView*)webView handler:(WVJBHandler)handler;
+ (id)bridgeForWebView:(UIWebView*)webView webViewDelegate:(id <UIWebViewDelegate>)webViewDelegate handler:(WVJBHandler)handler;
+ (void)enableLogging;
+ (void)disableLogging;
- (void)send:(id)message;
- (void)send:(id)message responseCallback:(WVJBResponseCallback)responseCallback;
- (void)registerHandler:(NSString*)handlerName handler:(WVJBHandler)handler;
Expand Down
5 changes: 3 additions & 2 deletions WebViewJavascriptBridge/WebViewJavascriptBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ + (id)bridgeForWebView:(UIWebView *)webView webViewDelegate:(id<UIWebViewDelegat
return bridge;
}

static bool logging = false;
+ (void)enableLogging { logging = true; }
static bool logging = NO;
+ (void)enableLogging { logging = YES; }
+ (void)disableLogging { logging = NO; }

- (void)send:(NSDictionary *)data {
[self send:data responseCallback:nil];
Expand Down

0 comments on commit 5775ebb

Please sign in to comment.