Phergie\Irc\Bot\React\Bot::getLogger PHP Метод

getLogger() публичный Метод

Returns the logger in use by the bot.
public getLogger ( ) : Psr\Log\LoggerInterface
Результат Psr\Log\LoggerInterface
    public function getLogger()
    {
        if (!$this->logger) {
            $this->logger = $this->getClient()->getLogger();
        }
        return $this->logger;
    }

Usage Example

Пример #1
0
 /**
  * Tests that dependencies can be overridden via configuration.
  */
 public function testOverrideDependencies()
 {
     $client = $this->getMockClient();
     $logger = $this->getMockLogger();
     $parser = $this->getMockParser();
     $converter = $this->getMockConverter();
     $eventQueueFactory = $this->getMockEventQueueFactory();
     $config = array('client' => $client, 'logger' => $logger, 'parser' => $parser, 'converter' => $converter, 'eventQueueFactory' => $eventQueueFactory, 'plugins' => array(), 'connections' => array($this->getMockConnection()));
     $this->bot->setConfig($config);
     $this->bot->run();
     $this->assertSame($client, $this->bot->getClient());
     $this->assertSame($logger, $this->bot->getLogger());
     $this->assertSame($parser, $this->bot->getParser());
     $this->assertSame($converter, $this->bot->getConverter());
     $this->assertSame($eventQueueFactory, $this->bot->getEventQueueFactory());
 }
All Usage Examples Of Phergie\Irc\Bot\React\Bot::getLogger