Skip to content

Commit

Permalink
Improve logging in DevServicesElasticsearchProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Feb 22, 2023
1 parent 6061bdf commit 476cb0b
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public DevServicesResultBuildItem startElasticsearchDevService(
}

StartupLogCompressor compressor = new StartupLogCompressor(
(launchMode.isTest() ? "(test) " : "") + "Elasticsearch Dev Services Starting:",
(launchMode.isTest() ? "(test) " : "") + "Dev Services for Elasticsearch starting:",
consoleInstalledBuildItem, loggingSetupBuildItem);
try {
devService = startElasticsearch(dockerStatusBuildItem, configuration, buildItemsConfig, launchMode,
Expand Down Expand Up @@ -153,14 +153,14 @@ private DevServicesResultBuildItem.RunningDevService startElasticsearch(
LaunchModeBuildItem launchMode, boolean useSharedNetwork, Optional<Duration> timeout) throws BuildException {
if (!config.enabled.orElse(true)) {
// explicitly disabled
log.debug("Not starting dev services for Elasticsearch, as it has been disabled in the config.");
log.debug("Not starting Dev Services for Elasticsearch, as it has been disabled in the config.");
return null;
}

for (String hostsConfigProperty : buildItemConfig.hostsConfigProperties) {
// Check if elasticsearch hosts property is set
if (ConfigUtils.isPropertyPresent(hostsConfigProperty)) {
log.debugf("Not starting dev services for Elasticsearch, the %s property is configured.", hostsConfigProperty);
log.debugf("Not starting Dev Services for Elasticsearch, the %s property is configured.", hostsConfigProperty);
return null;
}
}
Expand All @@ -173,7 +173,7 @@ private DevServicesResultBuildItem.RunningDevService startElasticsearch(

// We only support ELASTIC container for now
if (buildItemConfig.distribution == DevservicesElasticsearchBuildItem.Distribution.OPENSEARCH) {
throw new BuildException("Dev services for Elasticsearch didn't support Opensearch", Collections.emptyList());
throw new BuildException("Dev Services for Elasticsearch doesn't support OpenSearch", Collections.emptyList());
}

// Hibernate Search Elasticsearch have a version configuration property, we need to check that it is coherent
Expand All @@ -182,9 +182,9 @@ private DevServicesResultBuildItem.RunningDevService startElasticsearch(
String containerTag = config.imageName.substring(config.imageName.indexOf(':') + 1);
if (!containerTag.startsWith(buildItemConfig.version)) {
throw new BuildException(
"Dev services for Elasticsearch detected a version mismatch, container image is " + config.imageName
"Dev Services for Elasticsearch detected a version mismatch, container image is " + config.imageName
+ " but the configured version is " + buildItemConfig.version +
". Either configure a different image or disable dev services for Elasticsearch.",
". Either configure a different image or disable Dev Services for Elasticsearch.",
Collections.emptyList());
}
}
Expand Down Expand Up @@ -254,7 +254,7 @@ private DevservicesElasticsearchBuildItemsConfiguration(List<DevservicesElastics
version = buildItem.getVersion();
} else if (!version.equals(buildItem.getVersion())) {
// safety guard but should never occur as only Hibernate Search ORM Elasticsearch configure the version
throw new BuildException("Multiple extensions request Elasticsearch Dev Services on different version.",
throw new BuildException("Multiple extensions request different versions of Elasticsearch for Dev Services.",
Collections.emptyList());
}

Expand All @@ -263,7 +263,7 @@ private DevservicesElasticsearchBuildItemsConfiguration(List<DevservicesElastics
} else if (!distribution.equals(buildItem.getDistribution())) {
// safety guard but should never occur as only Hibernate Search ORM Elasticsearch configure the distribution
throw new BuildException(
"Multiple extensions request Elasticsearch Dev Services on different distribution.",
"Multiple extensions request different distributions of Elasticsearch for Dev Services.",
Collections.emptyList());
}

Expand Down

0 comments on commit 476cb0b

Please sign in to comment.