logger() public static method

public static logger ( ) : Consolidation\Log\Logger
return Consolidation\Log\Logger
Exemplo n.º 1
0
 protected function _before()
 {
     $progressBar = test::double('Symfony\\Component\\Console\\Helper\\ProgressBar');
     $nullOutput = new \Symfony\Component\Console\Output\NullOutput();
     $progressIndicator = new \Robo\Common\ProgressIndicator($progressBar, $nullOutput);
     $this->svn = test::double('Robo\\Task\\Vcs\\SvnStack', ['executeCommand' => new \AspectMock\Proxy\Anything(), 'output' => $nullOutput, 'logger' => new \Psr\Log\NullLogger(), 'logger' => Robo::logger(), 'getConfig' => Robo::config(), 'progressIndicator' => $progressIndicator]);
 }
Exemplo n.º 2
0
Arquivo: TaskIO.php Projeto: jjok/Robo
 /**
  * @return mixed|null|\Psr\Log\LoggerInterface
  */
 public function logger()
 {
     // $this->logger should always be set in Robo core tasks.
     if ($this->logger) {
         return $this->logger;
     }
     // TODO: Remove call to Robo::logger() once maintaining backwards
     // compatibility with legacy external Robo tasks is no longer desired.
     if (!Robo::logger()) {
         return null;
     }
     static $gaveDeprecationWarning = false;
     if (!$gaveDeprecationWarning) {
         trigger_error('No logger set for ' . get_class($this) . '. Use $this->task(Foo::class) rather than new Foo() in loadTasks to ensure the builder can initialize task the task, or use $this->collectionBuilder()->taskFoo() if creating one task from within another.', E_USER_DEPRECATED);
         $gaveDeprecationWarning = true;
     }
     return Robo::logger();
 }