You are here

public function Debugger::__construct in Acquia Purge 8

Construct a debugger.

Parameters

\Drupal\purge\Logger\LoggerChannelPartInterface $logger: The logger passed to the Platform CDN purger.

Overrides DebuggerInterface::__construct

File

src/Plugin/Purge/Purger/Debugger.php, line 45

Class

Debugger
Provides a centralized debugger for Acquia purger plugins.

Namespace

Drupal\acquia_purge\Plugin\Purge\Purger

Code

public function __construct(LoggerChannelPartInterface $logger) {
  $this
    ->setLogger($logger);

  // Only enable the debugger when running in CLI context (e.g. Drush).
  if (php_sapi_name() == 'cli') {
    $this->enabled = $logger
      ->isDebuggingEnabled();
  }
  $this
    ->callerAdd(__CLASS__);
}