You are here

protected function CleanerCacheClearEventSubscriber::writeToLog in Cleaner 8.2

Write a message about successful or not cache tables clearing.

Parameters

int $count: Count of tables cleared. Defaults to 0.

1 call to CleanerCacheClearEventSubscriber::writeToLog()
CleanerCacheClearEventSubscriber::clearCaches in src/EventSubscriber/CleanerCacheClearEventSubscriber.php
Cleaner caches clearing.

File

src/EventSubscriber/CleanerCacheClearEventSubscriber.php, line 170

Class

CleanerCacheClearEventSubscriber
Class CleanerCacheClearEventSubscriber.

Namespace

Drupal\cleaner\EventSubscriber

Code

protected function writeToLog($count = 0) {
  if ($count > 0) {
    $this->loggerChannel
      ->info('Cleared @count cache tables by Cleaner.', [
      '@count' => $count,
    ]);
  }
  else {
    $this->loggerChannel
      ->error('There are no selected cache tables in the database.');
  }
}