mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Report logs in dev to server on iOS
Summary: This diff adds server side logging for all log levels in development (some levels sampled) There are two new mobile analytic event pipelines (that pipe to scuba table) - rn_dev_logs ([pigeon](https://our.intern.facebook.com/intern/marauder/event/?name=rn_dev_logs) [scuba](https://fburl.com/scuba/pqxl6mf5)) - rn_dev_logs_sampled ([pigeon](https://our.intern.facebook.com/intern/marauder/event/?name=rn_dev_logs_sampled) [scuba](https://fburl.com/scuba/oqz6b5x3)) Notes: - All React Native logs from JS and Native on iOS go through this path to be printed to the console, so everything will be caputured even though native errors/warnings do not necessarily show a red/yellow box - All errors and warnings are logged - Log level info is sampled Reviewed By: sammy-SC Differential Revision: D17789494 fbshipit-source-id: dea6359237dbd91f267949f5185a0c79bb4083b8
This commit is contained in:
committed by
Facebook Github Bot
parent
9cefc96e43
commit
c71bbb0057
@@ -78,6 +78,16 @@ RCT_EXTERN NSString *RCTFormatLog(
|
||||
NSString *message
|
||||
);
|
||||
|
||||
/**
|
||||
* A method to generate a string RCTLogLevel
|
||||
*/
|
||||
RCT_EXTERN NSString *RCTFormatLogLevel(RCTLogLevel);
|
||||
|
||||
/**
|
||||
* A method to generate a string from a RCTLogSource
|
||||
*/
|
||||
RCT_EXTERN NSString *RCTFormatLogSource(RCTLogSource);
|
||||
|
||||
/**
|
||||
* The default logging function used by RCTLogXX.
|
||||
*/
|
||||
|
||||
@@ -162,6 +162,25 @@ NSString *RCTFormatLog(
|
||||
return log;
|
||||
}
|
||||
|
||||
NSString *RCTFormatLogLevel(RCTLogLevel level)
|
||||
{
|
||||
NSDictionary *levelsToString = @{@(RCTLogLevelTrace) : @"trace",
|
||||
@(RCTLogLevelInfo) : @"info",
|
||||
@(RCTLogLevelWarning) : @"warning",
|
||||
@(RCTLogLevelFatal) : @"fatal",
|
||||
@(RCTLogLevelError) : @"error"};
|
||||
|
||||
return levelsToString[@(level)];
|
||||
}
|
||||
|
||||
NSString *RCTFormatLogSource(RCTLogSource source)
|
||||
{
|
||||
NSDictionary *sourcesToString = @{@(RCTLogSourceNative) : @"native",
|
||||
@(RCTLogSourceJavaScript) : @"js"};
|
||||
|
||||
return sourcesToString[@(source)];
|
||||
}
|
||||
|
||||
static NSRegularExpression *nativeStackFrameRegex()
|
||||
{
|
||||
static dispatch_once_t onceToken;
|
||||
|
||||
Reference in New Issue
Block a user