You are here

protected function UpdateLogger::getCliLogger in Update helper 2.x

Same name and namespace in other branches
  1. 8 src/UpdateLogger.php \Drupal\update_helper\UpdateLogger::getCliLogger()

Returns console logger.

Return value

\Psr\Log\LoggerInterface Returns console logger.

1 call to UpdateLogger::getCliLogger()
UpdateLogger::outputCli in src/UpdateLogger.php
Output logs in format suitable for console command and clear logs too.

File

src/UpdateLogger.php, line 85

Class

UpdateLogger
Helper service for logging in update hooks provided by update helper.

Namespace

Drupal\update_helper

Code

protected function getCliLogger() {
  if (empty($this->cliLogger)) {
    $this->cliLogger = new ConsoleLogger(new StreamOutput(fopen($this->cliOutput, 'w'), OutputInterface::VERBOSITY_DEBUG));
  }
  return $this->cliLogger;
}