Skip to content

Commit

Permalink
GEODE-6810: Removed Superfluous Log Message
Browse files Browse the repository at this point in the history
The log message is the same as the log message a few lines down which results in extra spam in the logs. Improved other logs in the same file (replaces calls to String.format(), unnecessary checks etc.)
  • Loading branch information
meme-lord authored and kirklund committed Jun 17, 2019
1 parent 1042f15 commit bbac086
Showing 1 changed file with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ ServerLocationResponse queryOneLocatorUsingConnection(HostAddress locator,
updateLocatorInLocatorList(locator);
return null;
} catch (ClassNotFoundException e) {
logger.warn(String.format("Received exception from locator %s", locator),
e);
logger.warn("Received exception from locator {}", locator, e);
return null;
} catch (ClassCastException e) {
if (logger.isDebugEnabled()) {
Expand Down Expand Up @@ -245,15 +244,13 @@ protected void updateLocatorInLocatorList(HostAddress locator) {
locator.getSocketInetAddressNoLookup().getPort());
HostAddress hostAddress = new HostAddress(changeLoc, locator.getHostName());
newLocatorsList.add(hostAddress);
logger.info("updateLocatorInLocatorList changing locator list: loc form: " + locator
+ " ,loc to: " + changeLoc);
} else {
newLocatorsList.add(tloc);
}
}

logger.info("updateLocatorInLocatorList locator list from:" + locatorList.getLocators()
+ " to: " + newLocatorsList);
logger.info("updateLocatorInLocatorList locator list from: {} to {}",
locatorList.getLocators(), newLocatorsList);

LocatorList newLocatorList = new LocatorList(newLocatorsList);
locators.set(newLocatorList);
Expand Down Expand Up @@ -319,8 +316,7 @@ private void updateLocatorList(LocatorListResponse response) {
addedLocators.removeAll(oldLocators.getLocators());
if (!addedLocators.isEmpty()) {
locatorCallback.locatorsDiscovered(Collections.unmodifiableList(addedLocators));
logger.info("AutoConnectionSource discovered new locators {}",
addedLocators);
logger.info("AutoConnectionSource discovered new locators {}", addedLocators);
}
if (!removedLocators.isEmpty()) {
locatorCallback.locatorsRemoved(Collections.unmodifiableList(removedLocators));
Expand Down Expand Up @@ -381,18 +377,17 @@ public void setLocatorDiscoveryCallback(LocatorDiscoveryCallback callback) {
private synchronized void reportLiveLocator(InetSocketAddress l) {
Object prevState = this.locatorState.put(l, null);
if (prevState != null) {
logger.info("Communication has been restored with locator {}.",
l);
logger.info("Communication has been restored with locator {}.", l);
}
}

private synchronized void reportDeadLocator(InetSocketAddress l, Exception ex) {
Object prevState = this.locatorState.put(l, ex);
if (prevState == null) {
if (ex instanceof ConnectException) {
logger.info(String.format("locator %s is not running.", l), ex);
logger.info("locator {} is not running.", l, ex);
} else {
logger.info(String.format("Communication with locator %s failed with %s.", l, ex), ex);
logger.info("Communication with locator {} failed", l, ex);
}
}
}
Expand Down

0 comments on commit bbac086

Please sign in to comment.