Task #48876
Story #48874: As a developer I want a PSR-3 compatible Logging API
PSR-3: throw InvalidArgumentException on undefined severity
100%
Description
PSR-3 expects \TYPO3\CMS\Core\Log\Logger::log($severity, ...) to throw an InvalidArgumentException when the given $severity is undefined.
The core logging API validates the severity in \TYPO3\CMS\Core\Log\LogLevel::validateLevel() and throws a RangeException in case of undefined severities, because it uses integer values as severity instead of strings.
Solution would be to use InvalidArgumentException if a string was given instead.
Updated by Helmut Hummel about 9 years ago
Steffen Müller wrote:
PSR-3 expects \TYPO3\CMS\Core\Log\Logger::log($severity, ...) to throw an InvalidArgumentException when the given $severity is undefined.
It expects a Psr\Log\InvalidArgumentException to be thrown.
The core logging API validates the severity in \TYPO3\CMS\Core\Log\LogLevel::validateLevel() and throws a RangeException in case of undefined severities, because it uses integer values as severity instead of strings.
Solution would be to use InvalidArgumentException if a string was given instead.
Why not throwing a Psr\Log\InvalidArgumentException in any case?
Would still be semantically correct.
Or introduce a TYPO3\CMS\Log\InvalidLogLevelException which extends Psr\Log\InvalidArgumentException
Updated by Gerrit Code Review about 9 years ago
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21847
Updated by Gerrit Code Review about 9 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21847
Updated by Gerrit Code Review about 9 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21847
Updated by Gerrit Code Review about 9 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/21847
Updated by Steffen Müller about 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
applied in changeset 9aabc565