mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[PR #868] [MERGED] Added the NoopHandler. #1388
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#1388
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Seldaek/monolog/pull/868
Author: @ComaVN
Created: 10/12/2016
Status: ✅ Merged
Merged: 11/13/2016
Merged by: @Seldaek
Base:
master← Head:noop-handler📝 Commits (2)
7284f7dAdded the NoopHandler.c370308removed unused data provider in test📊 Changes
3 files changed (+93 additions, -0 deletions)
View changed files
📝
doc/02-handlers-formatters-processors.md(+2 -0)➕
src/Monolog/Handler/NoopHandler.php(+42 -0)➕
tests/Monolog/Handler/NoopHandlerTest.php(+49 -0)📄 Description
This handler handles anything, but does nothing, and does not stop bubbling to the rest of the stack, unlike the NullHandler.
This can be used for testing, or to disable a handler when overriding a configuration without influencing the rest of the stack.
The specific use-case I need this for is in symfony, where
config_test.ymlimportsconfig_dev.yml, but needs to disable some handlers and add some others:config_dev.yml:config_test.yml:This fails, because the
stderrhandler is first in the stack, even after overriding it. Because the NullHandler doesn't bubble, thetesthandler is never called. This would be solved withtype: 'noop'🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.