From b1701ccaefa0c8cbb6d820b2ad07e0d911027d7c Mon Sep 17 00:00:00 2001 From: Adam Ernst Date: Tue, 5 Dec 2017 10:19:18 -0800 Subject: [PATCH] Fix RCTInspectorPackagerConnection logspam for real Reviewed By: danzimm Differential Revision: D6486113 fbshipit-source-id: f6e661ce95ae89bafce9e0d773b484b28e4f83c4 --- React/Inspector/RCTInspectorPackagerConnection.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/React/Inspector/RCTInspectorPackagerConnection.m b/React/Inspector/RCTInspectorPackagerConnection.m index 5bce9397def8d9..93fb4e9e56af97 100644 --- a/React/Inspector/RCTInspectorPackagerConnection.m +++ b/React/Inspector/RCTInspectorPackagerConnection.m @@ -272,7 +272,10 @@ - (void)sendToPackager:(NSDictionary *)messageObject - (void)abort:(NSString *)message withCause:(NSError *)cause { - RCTLogTrace(@"Error occurred, shutting down websocket connection: %@ %@", message, cause); + // Don't log ECONNREFUSED at all; it's expected in cases where the server isn't listening. + if (![cause.domain isEqual:NSPOSIXErrorDomain] || cause.code != ECONNREFUSED) { + RCTLogInfo(@"Error occurred, shutting down websocket connection: %@ %@", message, cause); + } [self closeAllConnections]; [self disposeWebSocket];