16
16
#import < os/log.h>
17
17
#import < Instabug/IBGTypes.h>
18
18
#import < React/RCTUIManager.h>
19
+ #import " Util/IBGNetworkLogger+CP.h"
19
20
20
21
@interface Instabug (PrivateWillSendAPI)
21
22
+ (void )setWillSendReportHandler_private : (void (^)(IBGReport *report, void (^reportCompletionHandler)(IBGReport *)))willSendReportHandler_private ;
@@ -53,12 +54,13 @@ - (dispatch_queue_t)methodQueue {
53
54
for (NSNumber *boxedValue in invocationEventsArray) {
54
55
invocationEvents |= [boxedValue intValue ];
55
56
}
57
+ [IBGNetworkLogger disableAutomaticCapturingOfNetworkLogs ];
56
58
[Instabug startWithToken: token invocationEvents: invocationEvents];
57
59
[Instabug setSdkDebugLogsLevel: sdkDebugLogsLevel];
58
60
59
61
RCTAddLogFunction (InstabugReactLogFunction);
60
62
RCTSetLogThreshold (RCTLogLevelInfo);
61
-
63
+
62
64
IBGNetworkLogger.enabled = YES ;
63
65
64
66
// Temporarily disabling APM hot launches
@@ -72,7 +74,7 @@ - (dispatch_queue_t)methodQueue {
72
74
[[Instabug class ] performSelector: setPrivateApiSEL];
73
75
} else {
74
76
[[Instabug class ] performSelector: setPrivateApiSEL withObject: param];
75
-
77
+
76
78
}
77
79
}
78
80
}
@@ -349,7 +351,7 @@ - (dispatch_queue_t)methodQueue {
349
351
int32_t errorCode = [networkData[@" errorCode" ] integerValue ];
350
352
int64_t startTime = [networkData[@" startTime" ] integerValue ] * 1000 ;
351
353
int64_t duration = [networkData[@" duration" ] doubleValue ] * 1000 ;
352
-
354
+
353
355
NSString * gqlQueryName = nil ;
354
356
NSString * serverErrorMessage = nil ;
355
357
if (networkData[@" gqlQueryName" ] != [NSNull null ]) {
@@ -360,12 +362,12 @@ - (dispatch_queue_t)methodQueue {
360
362
}
361
363
362
364
SEL networkLogSEL = NSSelectorFromString (@" addNetworkLogWithUrl:method:requestBody:requestBodySize:responseBody:responseBodySize:responseCode:requestHeaders:responseHeaders:contentType:errorDomain:errorCode:startTime:duration:gqlQueryName:serverErrorMessage:" );
363
-
365
+
364
366
if ([[IBGNetworkLogger class ] respondsToSelector: networkLogSEL]) {
365
367
NSInvocation *inv = [NSInvocation invocationWithMethodSignature: [[IBGNetworkLogger class ] methodSignatureForSelector: networkLogSEL]];
366
368
[inv setSelector: networkLogSEL];
367
369
[inv setTarget: [IBGNetworkLogger class ]];
368
-
370
+
369
371
[inv setArgument: &(url) atIndex: 2 ];
370
372
[inv setArgument: &(method) atIndex: 3 ];
371
373
[inv setArgument: &(requestBody) atIndex: 4 ];
@@ -436,7 +438,7 @@ - (void) setBaseUrlForDeprecationLogs {
436
438
[inv setTarget: [Instabug class ]];
437
439
IBGPlatform platform = IBGPlatformReactNative;
438
440
[inv setArgument: &(platform) atIndex: 2 ];
439
-
441
+
440
442
[inv invoke ];
441
443
}
442
444
}
@@ -469,7 +471,7 @@ void RNIBGLog(IBGLogLevel logLevel, NSString *format, ...) {
469
471
{
470
472
NSString *formatString = @" Instabug - REACT LOG: %@ " ;
471
473
NSString *log = RCTFormatLog ([NSDate date ], level, fileName, lineNumber, message);
472
-
474
+
473
475
switch (level) {
474
476
case RCTLogLevelTrace:
475
477
RNIBGLog (IBGLogLevelVerbose, formatString, log);
0 commit comments