mirror of
https://github.com/status-im/instabug-reactnative.git
synced 2025-03-02 14:10:40 +00:00
🤝 Merge pull request #76 from Instabug/hotfix/fix_ios_crash
🐛 Fix a crash for iOS that results in Bad Access
This commit is contained in:
commit
61a8f77224
@ -452,26 +452,28 @@ RCTLogFunction InstabugReactLogFunction = ^(
|
||||
{
|
||||
NSString *log = RCTFormatLog([NSDate date], level, fileName, lineNumber, message);
|
||||
NSString *compeleteLog = [NSString stringWithFormat:@"Instabug - REACT LOG: %@", log];
|
||||
|
||||
va_list arg_list;
|
||||
|
||||
switch(level) {
|
||||
case RCTLogLevelTrace:
|
||||
IBGNSLogWithLevel(compeleteLog, arg_list, IBGLogLevelTrace);
|
||||
break;
|
||||
case RCTLogLevelInfo:
|
||||
IBGNSLogWithLevel(compeleteLog, arg_list, IBGLogLevelInfo);
|
||||
break;
|
||||
case RCTLogLevelWarning:
|
||||
IBGNSLogWithLevel(compeleteLog, arg_list, IBGLogLevelWarning);
|
||||
break;
|
||||
case RCTLogLevelError:
|
||||
IBGNSLogWithLevel(compeleteLog, arg_list, IBGLogLevelError);
|
||||
break;
|
||||
case RCTLogLevelFatal:
|
||||
IBGNSLogWithLevel(compeleteLog, arg_list, IBGLogLevelFatal);
|
||||
break;
|
||||
}
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
va_list arg_list;
|
||||
|
||||
switch(level) {
|
||||
case RCTLogLevelTrace:
|
||||
IBGNSLogWithLevel(compeleteLog, arg_list, IBGLogLevelTrace);
|
||||
break;
|
||||
case RCTLogLevelInfo:
|
||||
IBGNSLogWithLevel(compeleteLog, arg_list, IBGLogLevelInfo);
|
||||
break;
|
||||
case RCTLogLevelWarning:
|
||||
IBGNSLogWithLevel(compeleteLog, arg_list, IBGLogLevelWarning);
|
||||
break;
|
||||
case RCTLogLevelError:
|
||||
IBGNSLogWithLevel(compeleteLog, arg_list, IBGLogLevelError);
|
||||
break;
|
||||
case RCTLogLevelFatal:
|
||||
IBGNSLogWithLevel(compeleteLog, arg_list, IBGLogLevelFatal);
|
||||
break;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@end
|
||||
|
Loading…
x
Reference in New Issue
Block a user