Skip to content

Commit

Permalink
Cleanup logging a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed Jul 28, 2023
1 parent db8da56 commit 189e6f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,8 @@ public Map<String, Object> getSchema() {
SchemaRequest.Fields fieldsReq = new SchemaRequest.Fields();
try {
fieldsRes = Optional.ofNullable(fieldsReq.process(solrClient, index.getName()));
} catch (SolrServerException e) {
logger.error("Unable to get fields from collection ... continue", e);
} catch (IOException e) {
logger.error("Unable to get fields from collection ... continue", e);
} catch (SolrServerException | IOException e) {
logger.error("Unable to get fields from collection", e);
}

} else {
Expand All @@ -122,12 +120,9 @@ public Map<String, Object> getSchema() {

@PostConstruct
public void startup() {
logger.info("Scaffolding index fields...");
indexers.stream().forEach(indexer -> {
logger.info("Scaffolding {} fields.", indexer.name());
indexer.scaffold();
});

if (index.isInitOnStartup()) {
if (schematizing.compareAndSet(false, true)) {

Expand Down Expand Up @@ -212,10 +207,8 @@ private Object[] ping() {

try {
response = Optional.ofNullable(solrClient.ping(index.getName()));
} catch (SolrServerException e) {
logger.error("Unable to connect to Solr ... continue", e);
} catch (IOException e) {
logger.error("Unable to connect to Solr ... continue", e);
} catch (SolrServerException | IOException e) {
logger.error("Unable to connect to Solr", e);
}

if (response.isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void init(Map<String, Object> schema) {
Map<String, Object> field = (Map<String, Object>) schema.get(ntf.name);
if (Objects.nonNull(field)) {

logger.info("Field {}.{} already exists", this.name(), ntf.name);
logger.debug("Field {}.{} already exists", this.name(), ntf.name);

// TODO: type these maps or not
// TODO: match version and declared field type in case field type definition changes
Expand Down

0 comments on commit 189e6f1

Please sign in to comment.