diff --git a/React/Base/RCTLog.h b/React/Base/RCTLog.h index 3477b48c616deb..dbc17d1e446e4b 100644 --- a/React/Base/RCTLog.h +++ b/React/Base/RCTLog.h @@ -71,8 +71,6 @@ typedef void (^RCTLogFunction)( * particular data from the log, just pass nil or zero for the argument. */ RCT_EXTERN NSString *RCTFormatLog( - NSDate *timestamp, - RCTLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message diff --git a/React/Base/RCTLog.mm b/React/Base/RCTLog.mm index dd11bc38b00e8a..d354be193a4bcf 100644 --- a/React/Base/RCTLog.mm +++ b/React/Base/RCTLog.mm @@ -53,7 +53,7 @@ void RCTSetLogThreshold(RCTLogLevel threshold) { NSString *message ) { - NSString *log = RCTFormatLog([NSDate date], level, fileName, lineNumber, message); + NSString *log = RCTFormatLog(fileName, lineNumber, message); fprintf(stderr, "%s\n", log.UTF8String); fflush(stderr); @@ -145,28 +145,16 @@ void RCTPerformBlockWithLogPrefix(void (^block)(void), NSString *prefix) } NSString *RCTFormatLog( - NSDate *timestamp, - RCTLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message ) { NSMutableString *log = [NSMutableString new]; - if (timestamp) { - static NSDateFormatter *formatter; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - formatter = [NSDateFormatter new]; - formatter.dateFormat = formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss.SSS "; - }); - [log appendString:[formatter stringFromDate:timestamp]]; - } - if (level) { - [log appendFormat:@"[%s]", RCTLogLevels[level]]; - } - [log appendFormat:@"[tid:%@]", RCTCurrentThreadName()]; + if ([RCTCurrentThreadName() isEqualToString:@"com.facebook.react.JavaScript"]) { + [log appendFormat:@"[JS]"]; + } if (fileName) { fileName = fileName.lastPathComponent;