$this->logger->info($this->t('The following datasources of @index were successfully scheduled for reindexing: @datasources.',$arguments));
$this->logSuccess($this->t('The following datasources of @index were successfully scheduled for reindexing: @datasources.',$arguments));
}
else{
$index->reindex();
$this->logger->info($this->t('@index was successfully scheduled for reindexing.',['@index'=>$index->label()]));
$this->logSuccess($this->t('@index was successfully scheduled for reindexing.',['@index'=>$index->label()]));
}
}
...
...
@@ -415,7 +416,7 @@ class CommandHelper implements LoggerAwareInterface {
foreach($indexesas$index){
if($index->status()){
$index->rebuildTracker();
$this->logger->info($this->t('The tracking information for search index %name will be rebuilt.',['%name'=>$index->label()]));
$this->logSuccess($this->t('The tracking information for search index %name will be rebuilt.',['%name'=>$index->label()]));
}
}
returnTRUE;
...
...
@@ -443,7 +444,7 @@ class CommandHelper implements LoggerAwareInterface {
foreach($indexesas$index){
if($index->status()){
$index->clear();
$this->logger->info($this->t('@index was successfully cleared.',['@index'=>$index->label()]));
$this->logSuccess($this->t('@index was successfully cleared.',['@index'=>$index->label()]));
}
}
...
...
@@ -637,7 +638,7 @@ class CommandHelper implements LoggerAwareInterface {
$index=$this->reloadEntityOverrideFree($index);
$index->setServer($server);
$index->save();
$this->logger->info($this->t('Index @index has been set to use server @server and items have been queued for indexing.',['@index'=>$indexId,'@server'=>$serverId]));
$this->logSuccess($this->t('Index @index has been set to use server @server and items have been queued for indexing.',['@index'=>$indexId,'@server'=>$serverId]));
}
catch(EntityStorageException$e){
$this->logger->warning($e->getMessage());
...
...
@@ -700,7 +701,7 @@ class CommandHelper implements LoggerAwareInterface {
$method=$enable?'enable':'disable';
if($index->status()==$enable){
$this->logger->info($this->t("The index @index is already @desired_state.",['@index'=>$index->label(),'@desired_state'=>$state_label]));
$this->logSuccess($this->t("The index @index is already @desired_state.",['@index'=>$index->label(),'@desired_state'=>$state_label]));
return;
}
if(!$index->getServerId()){
...
...
@@ -710,7 +711,7 @@ class CommandHelper implements LoggerAwareInterface {
$index=$this->reloadEntityOverrideFree($index);
$index->$method()->save();
$this->logger->info($this->t("The index @index was successfully @desired_state.",['@index'=>$index->label(),'@desired_state'=>$state_label]));
$this->logSuccess($this->t("The index @index was successfully @desired_state.",['@index'=>$index->label(),'@desired_state'=>$state_label]));
}
/**
...
...
@@ -752,4 +753,22 @@ class CommandHelper implements LoggerAwareInterface {
]);
}
/**
* Logs a success message.
*
* Needed because Drush has a custom "success" log level that is incompatible
* with other loggers, but doesn't display "info" messages by default.