From 08af9c3f4dcb7b641cc1d4ef8bb09da958ce1e1b Mon Sep 17 00:00:00 2001 From: Jonny Burger Date: Mon, 24 Jun 2019 20:53:16 +0200 Subject: [PATCH 1/2] Update RCTLog.mm --- React/Base/RCTLog.mm | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) 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; From d2b06c98874a75dec9f9e78c03fc9ce7c2cd19c8 Mon Sep 17 00:00:00 2001 From: Jonny Burger Date: Mon, 24 Jun 2019 21:01:56 +0200 Subject: [PATCH 2/2] Update RCTLog.h --- React/Base/RCTLog.h | 2 -- 1 file changed, 2 deletions(-) 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