mirror of
https://github.com/status-im/react-native.git
synced 2025-02-27 08:30:34 +00:00
Back out "[react-native][PR] Prevent console logging on iOS 11.3+ within WebSocket"
Differential Revision: D7947829 Ninja: master broken fbshipit-source-id: 282c574897684ce48e9e7461067805a3ec5c1de1
This commit is contained in:
parent
3bc2696d65
commit
c2c352024f
@ -19,29 +19,6 @@
|
|||||||
|
|
||||||
#if RCT_DEV // Only supported in dev mode
|
#if RCT_DEV // Only supported in dev mode
|
||||||
|
|
||||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 100300 /* __IPHONE_10_3 */
|
|
||||||
|
|
||||||
// From https://github.com/apple/swift/blob/ad40c770bfe372f879b530443a3d94761fe258a6/stdlib/public/SDK/os/os_log.m
|
|
||||||
typedef struct os_log_pack_s {
|
|
||||||
uint64_t olp_continuous_time;
|
|
||||||
struct timespec olp_wall_time;
|
|
||||||
const void *olp_mh;
|
|
||||||
const void *olp_pc;
|
|
||||||
const char *olp_format;
|
|
||||||
uint8_t olp_data[0];
|
|
||||||
} os_log_pack_s, *os_log_pack_t;
|
|
||||||
|
|
||||||
static void (*orig__nwlog_pack)(os_log_pack_t pack, os_log_type_t logType);
|
|
||||||
|
|
||||||
static void my__nwlog_pack(os_log_pack_t pack, os_log_type_t logType)
|
|
||||||
{
|
|
||||||
if (logType == OS_LOG_TYPE_ERROR && strstr(pack->olp_format, "Connection has no connected handler") == NULL) {
|
|
||||||
orig__nwlog_pack(pack, logType);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* __IPHONE_10_3 */
|
|
||||||
|
|
||||||
static void (*orig_nwlog_legacy_v)(int, char*, va_list);
|
static void (*orig_nwlog_legacy_v)(int, char*, va_list);
|
||||||
|
|
||||||
static void my_nwlog_legacy_v(int level, char *format, va_list args) {
|
static void my_nwlog_legacy_v(int level, char *format, va_list args) {
|
||||||
@ -86,11 +63,6 @@ static void my_os_log_error_impl(void *dso, os_log_t log, os_log_type_t type, co
|
|||||||
rebind_symbols((struct rebinding[1]){
|
rebind_symbols((struct rebinding[1]){
|
||||||
{"nwlog_legacy_v", my_nwlog_legacy_v, (void *)&orig_nwlog_legacy_v}
|
{"nwlog_legacy_v", my_nwlog_legacy_v, (void *)&orig_nwlog_legacy_v}
|
||||||
}, 1);
|
}, 1);
|
||||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 100300 /* __IPHONE_10_3 */
|
|
||||||
rebind_symbols((struct rebinding[1]){
|
|
||||||
{"__nwlog_pack", my__nwlog_pack, (void *)&orig__nwlog_pack}
|
|
||||||
}, 1);
|
|
||||||
#endif /* __IPHONE_10_3 */
|
|
||||||
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
||||||
rebind_symbols((struct rebinding[1]){
|
rebind_symbols((struct rebinding[1]){
|
||||||
{"_os_log_error_impl", my_os_log_error_impl, (void *)&orig_os_log_error_impl}
|
{"_os_log_error_impl", my_os_log_error_impl, (void *)&orig_os_log_error_impl}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user