public function testGetLoggerLazyLoadsLoggerFromConfiguration()
 {
     $this->sc->setLoggerConfiguration('defaultLogger', array('type' => 'stream', 'path' => 'php://stderr'));
     $logger = $this->sc->getLogger();
     $this->assertInstanceOf('\\Monolog\\Logger', $logger);
     $handler = $logger->popHandler();
     $this->assertInstanceOf('\\Monolog\\Handler\\StreamHandler', $handler);
 }
 public function testGetProfilerUsesProfilerConfigurationWhenGiven()
 {
     $this->sc->setProfilerConfiguration(array('slowTreshold' => 22));
     $config = $this->sc->getProfiler()->getConfiguration();
     $this->assertEquals(22, $config['slowTreshold']);
 }
示例#3
0
 /**
  * @param \Propel\Runtime\ServiceContainer\StandardServiceContainer $serviceContainer
  *
  * @return void
  */
 private function addLogger(StandardServiceContainer $serviceContainer)
 {
     $loggerCollection = $this->getFactory()->createLogger();
     foreach ($loggerCollection as $logger) {
         $serviceContainer->setLogger($logger->getName(), $logger);
     }
 }