You are here

public function Debugger::write in Acquia Purge 8

Write a line to the logger's debug output stream.

Content will be prefixed depending on its depth in the call graph. Output will also be right-side padded up to $padlen, to improve readability when executed using 'drush -d', which adds timestamps at the end of each line.

Overrides DebuggerInterface::write

5 calls to Debugger::write()
Debugger::callerAdd in src/Plugin/Purge/Purger/Debugger.php
Register the current caller to the callgraph.
Debugger::callerRemove in src/Plugin/Purge/Purger/Debugger.php
Remove the current caller from the callgraph.
Debugger::writeSeparator in src/Plugin/Purge/Purger/Debugger.php
Write out a separator line to Drupal's debug output.
Debugger::writeTable in src/Plugin/Purge/Purger/Debugger.php
Write tabular data rendered as table to Drupal's debug output.
Debugger::writeTitle in src/Plugin/Purge/Purger/Debugger.php
Write a header title.

File

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

Class

Debugger
Provides a centralized debugger for Acquia purger plugins.

Namespace

Drupal\acquia_purge\Plugin\Purge\Purger

Code

public function write($line) {
  if (!$this->enabled) {
    throw new \LogicException("Cannot call ::write().");
  }
  $depth = $this
    ->indentationDepth();
  $prefix = str_repeat(' ', $depth);
  $suffix = '';
  if (($suffixlen = self::OUTPUT_BUFLEN - $depth - strlen($line)) > 0) {
    $suffix = str_repeat(' ', $suffixlen);
  }
  $this
    ->logger()
    ->debug($prefix . $line . $suffix);
}