Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
salmatarzi committed Sep 20, 2017
2 parents 3012d80 + 61a8f77 commit 9b67bad
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions ios/RNInstabug/InstabugReactBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -452,26 +452,28 @@ + (BOOL)iOSVersionIsLessThan:(NSString *)iOSVersion {
{
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

0 comments on commit 9b67bad

Please sign in to comment.