From 1518320bec1f1583a0c514491528d171501dc781 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 2 Sep 2013 12:20:30 +0200 Subject: [PATCH] Clarify/fix bubbling docs, fixes #229 --- README.mdown | 4 ++-- src/Monolog/Handler/AbstractHandler.php | 10 +++++----- src/Monolog/Handler/HandlerInterface.php | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.mdown b/README.mdown index 9d205469..1d5d13ca 100644 --- a/README.mdown +++ b/README.mdown @@ -45,8 +45,8 @@ the bottom of the stack that will log anything to disk, and on top of that add a `MailHandler` that will send emails only when an error message is logged. Handlers also have a `$bubble` property which defines whether they block the record or not if they handled it. In this example, setting the `MailHandler`'s -`$bubble` argument to true means that all records will propagate to the -`StreamHandler`, even the errors that are handled by the `MailHandler`. +`$bubble` argument to false means that records handled by the `MailHandler` will +not propagate to the `StreamHandler` anymore. You can create many `Logger`s, each defining a channel (e.g.: db, request, router, ..) and each of them combining various handlers, which can be shared diff --git a/src/Monolog/Handler/AbstractHandler.php b/src/Monolog/Handler/AbstractHandler.php index 3b8a9a6e..81fc7a37 100644 --- a/src/Monolog/Handler/AbstractHandler.php +++ b/src/Monolog/Handler/AbstractHandler.php @@ -23,7 +23,7 @@ use Monolog\Formatter\LineFormatter; abstract class AbstractHandler implements HandlerInterface { protected $level = Logger::DEBUG; - protected $bubble = false; + protected $bubble = true; /** * @var FormatterInterface @@ -141,8 +141,8 @@ abstract class AbstractHandler implements HandlerInterface /** * Sets the bubbling behavior. * - * @param Boolean $bubble True means that bubbling is not permitted. - * False means that this handler allows bubbling. + * @param Boolean $bubble true means that this handler allows bubbling. + * false means that bubbling is not permitted. * @return self */ public function setBubble($bubble) @@ -155,8 +155,8 @@ abstract class AbstractHandler implements HandlerInterface /** * Gets the bubbling behavior. * - * @return Boolean True means that bubbling is not permitted. - * False means that this handler allows bubbling. + * @return Boolean true means that this handler allows bubbling. + * false means that bubbling is not permitted. */ public function getBubble() { diff --git a/src/Monolog/Handler/HandlerInterface.php b/src/Monolog/Handler/HandlerInterface.php index a91db978..4e7d6392 100644 --- a/src/Monolog/Handler/HandlerInterface.php +++ b/src/Monolog/Handler/HandlerInterface.php @@ -46,8 +46,8 @@ interface HandlerInterface * calling further handlers in the stack with a given log record. * * @param array $record The record to handle - * @return Boolean True means that this handler handled the record, and that bubbling is not permitted. - * False means the record was either not processed or that this handler allows bubbling. + * @return Boolean true means that this handler handled the record, and that bubbling is not permitted. + * false means the record was either not processed or that this handler allows bubbling. */ public function handle(array $record);