You are here

protected static function CleanerCacheController::logResults in Cleaner 8

Write log about a clearing results.

Parameters

int|null $cleared: Count of cleared tables.

1 call to CleanerCacheController::logResults()
CleanerCacheController::clearTables in src/Controller/CleanerCacheController.php
Clear cache tables.

File

src/Controller/CleanerCacheController.php, line 77

Class

CleanerCacheController
Class CleanerCacheController.

Namespace

Drupal\cleaner\Controller

Code

protected static function logResults($cleared = NULL) {
  if ($cleared <= 0 || empty($cleared)) {
    static::$logLevel = LogLevel::ERROR;
    static::$logMessage = 'There are no selected tables in the database.';
  }
  else {
    static::$logLevel = LogLevel::INFO;
    static::$logMessage = 'Cleared tables by Cleaner.';
  }
  \Drupal::service('cleaner_logger')
    ->log(static::$logLevel, static::$logMessage);
}