Sokil\Mongo\Client::setLogger PHP Method

setLogger() public method

public setLogger ( Psr\Log\LoggerInterface $logger )
$logger Psr\Log\LoggerInterface
    public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
        return $this;
    }

Usage Example

示例#1
0
 public function testGetLogger()
 {
     $this->client->removeLogger();
     $this->assertFalse($this->client->hasLogger());
     $this->client->setLogger($this->getMock('\\Psr\\Log\\LoggerInterface'));
     $this->assertInstanceOf('\\Psr\\Log\\LoggerInterface', $this->client->getLogger());
 }