mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-30 18:00:17 +02:00
Merge branch '1.x'
This commit is contained in:
@@ -81,8 +81,9 @@ class GroupHandler extends Handler implements ProcessableHandlerInterface, Reset
|
||||
$processed = [];
|
||||
foreach ($records as $record) {
|
||||
foreach ($this->processors as $processor) {
|
||||
$processed[] = call_user_func($processor, $record);
|
||||
$record = call_user_func($processor, $record);
|
||||
}
|
||||
$processed[] = $record;
|
||||
}
|
||||
$records = $processed;
|
||||
}
|
||||
|
@@ -65,6 +65,7 @@ class StreamHandler extends AbstractProcessingHandler
|
||||
fclose($this->stream);
|
||||
}
|
||||
$this->stream = null;
|
||||
$this->dirCreated = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -50,8 +50,9 @@ class WhatFailureGroupHandler extends GroupHandler
|
||||
$processed = array();
|
||||
foreach ($records as $record) {
|
||||
foreach ($this->processors as $processor) {
|
||||
$processed[] = call_user_func($processor, $record);
|
||||
$record = call_user_func($processor, $record);
|
||||
}
|
||||
$processed[] = $record;
|
||||
}
|
||||
$records = $processed;
|
||||
}
|
||||
|
@@ -99,6 +99,11 @@ class GroupHandlerTest extends TestCase
|
||||
|
||||
return $record;
|
||||
});
|
||||
$handler->pushProcessor(function ($record) {
|
||||
$record['extra']['foo2'] = true;
|
||||
|
||||
return $record;
|
||||
});
|
||||
$handler->handleBatch([$this->getRecord(Logger::DEBUG), $this->getRecord(Logger::INFO)]);
|
||||
foreach ($testHandlers as $test) {
|
||||
$this->assertTrue($test->hasDebugRecords());
|
||||
@@ -107,6 +112,8 @@ class GroupHandlerTest extends TestCase
|
||||
$records = $test->getRecords();
|
||||
$this->assertTrue($records[0]['extra']['foo']);
|
||||
$this->assertTrue($records[1]['extra']['foo']);
|
||||
$this->assertTrue($records[0]['extra']['foo2']);
|
||||
$this->assertTrue($records[1]['extra']['foo2']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -99,6 +99,11 @@ class WhatFailureGroupHandlerTest extends TestCase
|
||||
|
||||
return $record;
|
||||
});
|
||||
$handler->pushProcessor(function ($record) {
|
||||
$record['extra']['foo2'] = true;
|
||||
|
||||
return $record;
|
||||
});
|
||||
$handler->handleBatch(array($this->getRecord(Logger::DEBUG), $this->getRecord(Logger::INFO)));
|
||||
foreach ($testHandlers as $test) {
|
||||
$this->assertTrue($test->hasDebugRecords());
|
||||
@@ -107,6 +112,8 @@ class WhatFailureGroupHandlerTest extends TestCase
|
||||
$records = $test->getRecords();
|
||||
$this->assertTrue($records[0]['extra']['foo']);
|
||||
$this->assertTrue($records[1]['extra']['foo']);
|
||||
$this->assertTrue($records[0]['extra']['foo2']);
|
||||
$this->assertTrue($records[1]['extra']['foo2']);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user