Skip to content

Commit 407d6af

Browse files
JonnyBurgeraleclarson
authored andcommitted
Remove asl_log (Fixes #25380) (#25382)
Summary: By default absolutely everything gets logged twice (facebook/react-native#25380). This was introduced over 4 years ago here: [React Native Log to ASL · facebook/react-native@d1b14ef · GitHub](facebook/react-native@d1b14ef) with the reason to support ASL. With this PR the support for that will be removed but I believe this is justified because: - the benefit of not having every log message twice far outweighs the benefit of having Apple System Log. - ASL was superseded by "unified logging" (yellow box on https://developer.apple.com/documentation/os/logging). - I assume that people who use asl_log is very small. There is also very little information about it on the internet ## Changelog [iOS] [Fixed] - Logs would get printed twice Pull Request resolved: facebook/react-native#25382 Differential Revision: D16048052 Pulled By: cpojer fbshipit-source-id: 51519570bbee79571e4ff63f433b9b70bcd55671
1 parent 2d00c06 commit 407d6af

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

React/Base/RCTLog.mm

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#import "RCTLog.h"
1111

12-
#include <asl.h>
1312
#include <cxxabi.h>
1413

1514
#import "RCTAssert.h"
@@ -58,26 +57,6 @@ void RCTSetLogThreshold(RCTLogLevel threshold) {
5857
NSString *log = RCTFormatLog([NSDate date], level, fileName, lineNumber, message);
5958
fprintf(stderr, "%s\n", log.UTF8String);
6059
fflush(stderr);
61-
62-
int aslLevel;
63-
switch(level) {
64-
case RCTLogLevelTrace:
65-
aslLevel = ASL_LEVEL_DEBUG;
66-
break;
67-
case RCTLogLevelInfo:
68-
aslLevel = ASL_LEVEL_NOTICE;
69-
break;
70-
case RCTLogLevelWarning:
71-
aslLevel = ASL_LEVEL_WARNING;
72-
break;
73-
case RCTLogLevelError:
74-
aslLevel = ASL_LEVEL_ERR;
75-
break;
76-
case RCTLogLevelFatal:
77-
aslLevel = ASL_LEVEL_CRIT;
78-
break;
79-
}
80-
asl_log(NULL, NULL, aslLevel, "%s", message.UTF8String);
8160
};
8261

8362
void RCTSetLogFunction(RCTLogFunction logFunction)

0 commit comments

Comments
 (0)