- Issue created by @larowlan
- π¬π§United Kingdom jonathanshaw Stroud, UK
In β¨ Allow kernel tests to fail or expect logged errors Needs work (https://git.drupalcode.org/project/drupal/-/merge_requests/14) we created an AssertableLogger that is much more sophisticated than either colinodell/testlogger or Symfony's BufferingLogger. The idea with colinodell/testlogger was that we would now extend AssertableLogger from that.
What we need for β¨ Allow kernel tests to fail or expect logged errors Needs work is so far beyond the capabilities of BufferingLogger (which offers so little code itself) that I doubt the complexity of adding BufferingLogger as a dependency is worth it. Honestly, I thought it was debatable whether colinodell/testlogger was worth it.
Additionally, as I understand it BufferingLogger basically temporarily stores logs and then flushes them on at the end of a request:
public function __destruct() { foreach ($this->logs as [$level, $message, $context]) { ... error_log(sprintf('%s [%s] %s', date(\DateTimeInterface::RFC3339), $level, $message)); } }
I find it hard to forsee the consequences of this behavior change for test DX.
- Status changed to Closed: won't fix
over 1 year ago 4:43pm 28 April 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Discussed with catch and lauriii
We agree that the DX doesn't justify it