Пример #1
0
 /**
  * @test
  */
 public function normalConstructionAndAccessors()
 {
     $entry = new Entry('test', 'INFO', 'Test message', ['abc' => 123]);
     $this->assertTrue($entry instanceof Entry);
     $this->assertEquals('test', $entry->getChannel());
     $this->assertEquals('INFO', $entry->getLevel());
     $this->assertEquals(200, $entry->getCode());
     $this->assertEquals('Test message', $entry->getMessage());
     $this->assertEquals(['abc' => 123], $entry->getContext());
 }
Пример #2
0
 /**
  * @param Entry $entry
  * @return null
  */
 public function write(Entry $entry)
 {
     $log = new MonologLogger($entry->getChannel());
     $log->pushHandler(new StreamHandler($this->getPath($entry->getChannel()), $entry->getCode()));
     $log->addRecord($entry->getCode(), $entry->getMessage(), $entry->getContext());
 }