[PR #843] [CLOSED] Add ConstStub awareness to NormalizerFormatter #1378

Closed
opened 2026-03-04 03:11:17 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Seldaek/monolog/pull/843
Author: @nicolas-grekas
Created: 9/2/2016
Status: Closed

Base: masterHead: const-stub


📝 Commits (1)

  • db062e2 Add ConstStub awareness to NormalizerFormatter

📊 Changes

3 files changed (+10 additions, -0 deletions)

View changed files

📝 composer.json (+1 -0)
📝 src/Monolog/Formatter/NormalizerFormatter.php (+5 -0)
📝 tests/Monolog/Formatter/NormalizerFormatterTest.php (+4 -0)

📄 Description

By wrapping context values into ConstStub objects, one can add precise type information to log contexts. Yet, this results in pure noise when the context is dumped into log files.
Since ConstStub is basically a value wrapper, NormalizerFormatter can remove it to get clean logs back.

This would be of paramount usefulness for the upcoming Symfony 3.2 profiler panel where we'd use this feature immediately to get a better log panel.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Seldaek/monolog/pull/843 **Author:** [@nicolas-grekas](https://github.com/nicolas-grekas) **Created:** 9/2/2016 **Status:** ❌ Closed **Base:** `master` ← **Head:** `const-stub` --- ### 📝 Commits (1) - [`db062e2`](https://github.com/Seldaek/monolog/commit/db062e258d1d8cac1ec2f3be3b465b126cb1bb26) Add ConstStub awareness to NormalizerFormatter ### 📊 Changes **3 files changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `composer.json` (+1 -0) 📝 `src/Monolog/Formatter/NormalizerFormatter.php` (+5 -0) 📝 `tests/Monolog/Formatter/NormalizerFormatterTest.php` (+4 -0) </details> ### 📄 Description By wrapping context values into [`ConstStub`](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/VarDumper/Caster/ConstStub.php) objects, one can add precise type information to log contexts. Yet, this results in pure noise when the context is dumped into log files. Since ConstStub is basically a value wrapper, NormalizerFormatter can remove it to get clean logs back. This would be of paramount usefulness for the upcoming Symfony 3.2 profiler panel where we'd use this feature immediately to get a better log panel. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 03:11:17 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#1378
No description provided.