|
5 | 5 |
|
6 | 6 | Copyright: (c) 2013-2017 by Instabug, Inc., all rights reserved. |
7 | 7 |
|
8 | | - Version: 6.3.1 |
| 8 | + Version: 6.4 |
9 | 9 | */ |
10 | 10 |
|
11 | 11 | #import <Foundation/Foundation.h> |
@@ -83,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN |
83 | 83 | |
84 | 84 | @param fileLocation Path to a file that's going to be attached to each report. |
85 | 85 | */ |
86 | | -+ (void)setFileAttachment:(NSString *)fileLocation DEPRECATED_MSG_ATTRIBUTE("Starting from v6.3, use setFileAttachmentWithURL: instead.");; |
| 86 | ++ (void)setFileAttachment:(NSString *)fileLocation DEPRECATED_MSG_ATTRIBUTE("Starting from v6.3, use setFileAttachmentWithURL: instead."); |
87 | 87 |
|
88 | 88 | /** |
89 | 89 | @brief Attaches a file to each report being sent. |
@@ -121,38 +121,6 @@ NS_ASSUME_NONNULL_BEGIN |
121 | 121 | */ |
122 | 122 | + (void)setUserStepsEnabled:(BOOL)isUserStepsEnabled; |
123 | 123 |
|
124 | | -/** |
125 | | - @brief Sets whether to log network requests or not. |
126 | | - |
127 | | - @discussion When enabled, Instabug will automtically log all network requests and responses. Logs are attached to |
128 | | - each report being sent and are available on your Instabug dashboard. |
129 | | - |
130 | | - Networking logging is enabled by default if it's available in your current plan. |
131 | | -
|
132 | | - @param isNetworkLoggingEnabled A boolean to set network logging to be enabled to disabled. |
133 | | - */ |
134 | | -+ (void)setNetworkLoggingEnabled:(BOOL)isNetworkLoggingEnabled; |
135 | | - |
136 | | -/** |
137 | | - @brief Specify an NSPredicate to be used to omit certain requests from being logged. |
138 | | -
|
139 | | - @discussion Predicate will be matched against an `NSURLRequest`. This can be used to filter out requests to a specific |
140 | | - domain for example. |
141 | | - |
142 | | - @param filterPredicate An NSPredicate to match against an NSURLRequest. Matching requests will be omitted. |
143 | | - */ |
144 | | -+ (void)setNetworkLoggingFilterPredicate:(NSPredicate *)filterPredicate; |
145 | | - |
146 | | -/** |
147 | | - @brief Enable logging for network requests and responses on a custom NSURLSessionConfiguration. |
148 | | - |
149 | | - @discussion Logging for network requests and responses may not work if you're using a custom `NSURLSession` object. |
150 | | - If this is the case, call this method passing in your custom NSURLSessions's configuration to enable logging for it. |
151 | | -
|
152 | | - @param URLSessionConfiguration The NSURLSessionConfiguration of your custom NSURLSession. |
153 | | - */ |
154 | | -+ (void)enableLoggingForURLSessionConfiguration:(NSURLSessionConfiguration *)URLSessionConfiguration; |
155 | | - |
156 | 124 | /** |
157 | 125 | @brief Sets whether to track and report crashes or not. |
158 | 126 | |
@@ -704,9 +672,7 @@ NS_ASSUME_NONNULL_BEGIN |
704 | 672 | */ |
705 | 673 | + (void)didReceiveRemoteNotification:(NSDictionary *)userInfo; |
706 | 674 |
|
707 | | -/// ------------- |
708 | | -/// @name Logging |
709 | | -/// ------------- |
| 675 | +#pragma mark - IBGLog |
710 | 676 |
|
711 | 677 | /** |
712 | 678 | @brief Adds custom logs that will be sent with each report. |
@@ -811,5 +777,85 @@ OBJC_EXTERN void IBGLogError(NSString *format, ...) NS_FORMAT_FUNCTION(1, 2); |
811 | 777 | */ |
812 | 778 | + (void)logError:(NSString *)log; |
813 | 779 |
|
| 780 | +#pragma mark - Network Logging |
| 781 | + |
| 782 | +/** |
| 783 | + @brief Sets whether to log network requests or not. |
| 784 | + |
| 785 | + @discussion When enabled, Instabug will automtically log all network requests and responses. Logs are attached to |
| 786 | + each report being sent and are available on your Instabug dashboard. |
| 787 | + |
| 788 | + Networking logging is enabled by default if it's available in your current plan. |
| 789 | + |
| 790 | + @param isNetworkLoggingEnabled A boolean to set network logging to be enabled to disabled. |
| 791 | + */ |
| 792 | ++ (void)setNetworkLoggingEnabled:(BOOL)isNetworkLoggingEnabled; |
| 793 | + |
| 794 | +/** |
| 795 | + @brief Specify an NSPredicate to be used to omit certain requests from being logged. |
| 796 | + |
| 797 | + @deprecated Use `setNetworkLoggingRequestFilterPredicate:responseFilterPredicate:` instead. |
| 798 | + |
| 799 | + @discussion Predicate will be matched against an `NSURLRequest`. This can be used to filter out requests to a specific |
| 800 | + domain for example. |
| 801 | + |
| 802 | + @param filterPredicate An NSPredicate to match against an NSURLRequest. Matching requests will be omitted. |
| 803 | + */ |
| 804 | ++ (void)setNetworkLoggingFilterPredicate:(NSPredicate *)filterPredicate DEPRECATED_MSG_ATTRIBUTE("Use setNetworkLoggingRequestFilterPredicate:responseFilterPredicate: instead."); |
| 805 | + |
| 806 | +/** |
| 807 | + @brief Specify NSPredicates to be used to omit certain network requests from being logged based on their request or |
| 808 | + response objects. |
| 809 | + |
| 810 | + @discussion `requestFilterPredicate` will be matched against an `NSURLRequest`. It can be used to filter out requests |
| 811 | + to a specific domain for example. |
| 812 | + |
| 813 | + `responseFilterPredicate` will be matched against an `NSHTTPURLResponse`. It can be used to filter out responses that |
| 814 | + match specific status codes. |
| 815 | + |
| 816 | + If both predicates are specified, `requestFilterPredicate` is evaluated first, if it matches, the request is omitted |
| 817 | + from logging without evaluating `responseFilterPredicate`. |
| 818 | + |
| 819 | + @param requestFilterPredicate An NSPredicate to match against an NSURLRequest. Matching requests will be omitted. |
| 820 | + @param responseFilterPredicate An NSPredicate to match against an NSHTTPURLResponse. Matching responses will be omitted. |
| 821 | + */ |
| 822 | ++ (void)setNetworkLoggingRequestFilterPredicate:(nullable NSPredicate *)requestFilterPredicate responseFilterPredicate:(nullable NSPredicate *)responseFilterPredicate; |
| 823 | + |
| 824 | +/** |
| 825 | + @brief Enable logging for network requests and responses on a custom NSURLSessionConfiguration. |
| 826 | + |
| 827 | + @discussion Logging for network requests and responses may not work if you're using a custom `NSURLSession` object. |
| 828 | + If this is the case, call this method passing in your custom NSURLSessions's configuration to enable logging for it. |
| 829 | + |
| 830 | + @param URLSessionConfiguration The NSURLSessionConfiguration of your custom NSURLSession. |
| 831 | + */ |
| 832 | ++ (void)enableLoggingForURLSessionConfiguration:(NSURLSessionConfiguration *)URLSessionConfiguration; |
| 833 | + |
| 834 | +/** |
| 835 | + @brief Set HTTP body of a POST request to be included in network logs. |
| 836 | + |
| 837 | + @discussion Due to a bug in Foundation, it's not possible to retrieve the body of POST requests automatically. Use |
| 838 | + this method to include the body of your POST requests in network logs. |
| 839 | + |
| 840 | + If you'd like to exclude or obfuscate user sensitive data in the request body, this is also the place to do it. |
| 841 | + |
| 842 | + @param body Body data of a POST request. |
| 843 | + @param request The POST request that is being sent. |
| 844 | + */ |
| 845 | ++ (void)logHTTPBody:(NSData *)body forRequest:(NSMutableURLRequest *)request; |
| 846 | + |
| 847 | +/** |
| 848 | + @brief Use to obfuscate a URL that's going to be included in network logs. |
| 849 | + |
| 850 | + @discussion Use this method if you make requests that include user sensitive data in the URL (like authentication tokens |
| 851 | + for example), and you'd like to hide those from your network logs. |
| 852 | + |
| 853 | + The provided block will be called for every request. You should do whatever processing you need to do on the URL inside |
| 854 | + that block, then return a URL to be included in network logs. |
| 855 | +
|
| 856 | + @param obfuscationHandler A block that obfuscates the passed URL and returns it. |
| 857 | + */ |
| 858 | ++ (void)setNetworkLoggingURLObfuscationHandler:(nonnull NSURL * (^)(NSURL * _Nonnull url))obfuscationHandler; |
| 859 | + |
814 | 860 | @end |
815 | 861 | NS_ASSUME_NONNULL_END |
0 commit comments