See also: ClassLoader
Author: Raphael Antonmattei (rantonmattei@theorchard.com)
Esempio n. 1
0
 /**
  * Configure the loggers
  *
  * @param  array $loggers array of logger options
  */
 protected function configureLoggers(array $loggers)
 {
     foreach ($loggers as $loggerName => $loggerOptions) {
         $loggerLoader = new LoggerLoader($loggerName, $loggerOptions, $this->handlers, $this->processors);
         $this->loggers[$loggerName] = $loggerLoader->load();
     }
 }
 public function testLoad()
 {
     $options = array('handlers' => array('test_handler_1', 'test_handler_2'), 'processors' => array('test_processor_1', 'test_processor_2'));
     $handlers = array('test_handler_1' => new TestHandler(), 'test_handler_2' => new TestHandler());
     $dummyClosure = function () {
         // Empty function
     };
     $processors = array('test_processor_1' => $dummyClosure, 'test_processor_2' => $dummyClosure);
     $loader = new LoggerLoader('testLogger', $options, $handlers, $processors);
     $logger = $loader->load();
     $this->assertTrue($logger instanceof Logger);
     $this->assertEquals(array_values($handlers), $logger->getHandlers());
     $this->assertEquals(array_values($processors), $logger->getProcessors());
 }