|
14 | 14 | import bugbattle.io.bugbattle.controller.BugBattleNotInitialisedException;
|
15 | 15 | import bugbattle.io.bugbattle.model.APPLICATIONTYPE;
|
16 | 16 | import bugbattle.io.bugbattle.model.FeedbackModel;
|
| 17 | +import bugbattle.io.bugbattle.model.Networklog; |
17 | 18 | import bugbattle.io.bugbattle.model.PhoneMeta;
|
| 19 | +import bugbattle.io.bugbattle.model.RequestType; |
18 | 20 | import bugbattle.io.bugbattle.service.BBDetector;
|
| 21 | +import bugbattle.io.bugbattle.service.BugBattleHttpInterceptor; |
19 | 22 | import bugbattle.io.bugbattle.service.ReplaysDetector;
|
20 | 23 | import bugbattle.io.bugbattle.service.ScreenshotGestureDetector;
|
21 | 24 | import bugbattle.io.bugbattle.service.ScreenshotTaker;
|
@@ -245,8 +248,26 @@ public static void setLanguage(String language) {
|
245 | 248 | FeedbackModel.getInstance().setLanguage(language);
|
246 | 249 | }
|
247 | 250 |
|
| 251 | + /** |
| 252 | + * Attach Data to the request. The Data will be merged into the body sent with the bugreport. |
| 253 | + * !!Existing keys can be overriten |
| 254 | + * @param data Data, which is added |
| 255 | + */ |
248 | 256 | public static void attachData(JSONObject data) {
|
249 | 257 | FeedbackModel.getInstance().setData(data);
|
250 | 258 | }
|
251 | 259 |
|
| 260 | + /** |
| 261 | + * Log network traffic by logging it manually. |
| 262 | + * @param urlConnection URL where the request is sent to |
| 263 | + * @param requestType GET, POST, PUT, DELETE |
| 264 | + * @param status status of the response (e.g. 200, 404) |
| 265 | + * @param duration duration of the request |
| 266 | + * @param request Add the data you want. e.g the body sent in the request |
| 267 | + * @param response Response of the call. You can add just the information you want and need. |
| 268 | + */ |
| 269 | + public static void logNetwork(String urlConnection, RequestType requestType, int status, int duration, JSONObject request, JSONObject response) { |
| 270 | + BugBattleHttpInterceptor.log(urlConnection, requestType, status, duration, request, response); |
| 271 | + } |
| 272 | + |
252 | 273 | }
|
0 commit comments