Add colinodell/psr-test-logger to core's dev dependencies

Created on 16 November 2022, about 2 years ago
Updated 28 April 2023, over 1 year ago

Problem/Motivation

Automatic Updates makes heavy use of psr/log's \Psr\Log\Test\TestLogger class. It's a hell of a lot easier to use than mocking a logger, and it's very necessary for Automatic Updates to test unattended updates, which run during cron and therefore only output to a logger channel.

The problem is, that class was removed from psr/log 3, which is used by Drupal 10! It now lives, unchanged, in an independent package called colinodell/psr-test-logger.

Although Automatic Updates could be refactored to use a mock logger, that would make the tests more complex, harder to read, and more painful to maintain.

Proposed resolution

Add colinodell/psr-test-logger to core's dev dependencies, after vetting it.

Remaining tasks

  1. and commit it. As we do.
  2. Unblock ๐Ÿ“Œ Adopt TestLogger for testing logging Closed: won't fix

Dependency evaluation

Repository: https://github.com/colinodell/psr-testlogger

This is a very simple package. Fundamentally it is single class:
https://github.com/colinodell/psr-testlogger/blob/main/src/TestLogger.php

Code quality

The project has unit tests and automated coding standards.

Maintainership of the package

Maintained by a single maintainer Colin O'Dell. He is an experienced php open source maintainer and a member of thephpleague leadership team. See https://github.com/colinodell. This package should required very little maintenance.

Security policies of the package

This is a dev dependency, should only be used in test code. The project has a policy of security issues being reported privately https://github.com/colinodell/psr-testlogger#reporting-security-issues

Expected release and support cycles

None stated. Likely would need to adapt only to new php versions.

Other dependencies it'd add, if any

None.

Release notes snippet

colinodell/psr-testlogger has been added to Drupal core's development dependencies.

๐Ÿ“Œ Task
Status

Fixed

Version

10.1 โœจ

Component
Otherย  โ†’

Last updated 1 day ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024