getLoggerService() public method

public getLoggerService ( ) : Service
return Phprest\Service\Logger\Service
示例#1
0
 public function testLoggerGetterSetter()
 {
     $config = new Config('phprest', 1, true);
     $config->setLoggerConfig(new LoggerConfig('test'));
     $config->setLoggerService(new LoggerService());
     $this->assertInstanceOf('\\Phprest\\Service\\Logger\\Config', $config->getLoggerConfig());
     $this->assertInstanceOf('\\Phprest\\Service\\Logger\\Service', $config->getLoggerService());
 }
示例#2
0
 /**
  * @param Config $configuration
  */
 public function __construct(Config $configuration)
 {
     $this->configuration = $configuration;
     $this->container = $configuration->getContainer();
     $this->router = $configuration->getRouter();
     $this->emitter = $configuration->getEventEmitter();
     AnnotationRegistry::registerLoader('class_exists');
     $this->registerService($configuration->getHateoasService(), $configuration->getHateoasConfig());
     $this->registerService($configuration->getLoggerService(), $configuration->getLoggerConfig());
     $this->setErrorHandler();
     $this->container->add(self::CONTAINER_ID_VENDOR, $configuration->getVendor());
     $this->container->add(self::CONTAINER_ID_API_VERSION, $configuration->getApiVersion());
     $this->container->add(self::CONTAINER_ID_DEBUG, $configuration->isDebug());
     $this->container->add(self::CONTAINER_ID_ROUTER, function () {
         return $this->router;
     });
     $this->stackBuilder = new Stack\Builder();
 }