Permalink
Browse files

merged branch Seldaek/monologbridge (PR #5297)

Commits
-------

e49afde Update monolog compatibility
832f8dd Add support for Monolog 1.2.0

Discussion
----------

Add support for Monolog 1.2.0

It's BC just in case someone still uses an older monolog version

---------------------------------------------------------------------------

by stloyd at 2012-08-19T07:20:24Z

IMO you should update `composer.json` too.

---------------------------------------------------------------------------

by Seldaek at 2012-08-19T07:36:51Z

1.* is still ok I think. Obviously the latest version is better, and if you update composer will pick the latest, but I don't think we need to force people to upgrade if there is no BC break.

---------------------------------------------------------------------------

by stloyd at 2012-08-19T07:46:31Z

But adding support for version `1.2` without changing `composer.json` which actually is: `>=1.0,<1.2-dev` is useless IMO.

---------------------------------------------------------------------------

by Seldaek at 2012-08-19T07:50:16Z

Where do you see `>=1.0,<1.2-dev`?

---------------------------------------------------------------------------

by stloyd at 2012-08-19T07:55:36Z

Here, in `2.0` branch: https://github.com/symfony/symfony/blob/2.0/composer.json#L21

---------------------------------------------------------------------------

by Seldaek at 2012-08-19T07:58:28Z

Ok fixed.. Everywhere else in the master branch it is required with `1.*` so I didn't get what you meant :)
  • Loading branch information...
2 parents ee572b3 + e49afde commit 07d108af5ec88b20efd1faf8931e15ec5b89df15 @fabpot fabpot committed Aug 19, 2012
Showing with 6 additions and 2 deletions.
  1. +1 −1 composer.json
  2. +5 −1 src/Symfony/Bridge/Monolog/Handler/DebugHandler.php
View
@@ -18,7 +18,7 @@
"require": {
"php": ">=5.3.2",
"doctrine/common": ">=2.1,<2.3-dev",
- "monolog/monolog": ">=1.0,<1.2-dev",
+ "monolog/monolog": ">=1.0,<1.3-dev",
"swiftmailer/swiftmailer": "4.2.*",
"twig/twig": ">=1.1,<2.0-dev"
},
@@ -47,7 +47,11 @@ public function getLogs()
public function countErrors()
{
$cnt = 0;
- foreach (array(Logger::ERROR, Logger::CRITICAL, Logger::ALERT) as $level) {
+ $levels = array(Logger::ERROR, Logger::CRITICAL, Logger::ALERT);
+ if (defined('Monolog\Logger::EMERGENCY')) {
+ $levels[] = Logger::EMERGENCY;
+ }
+ foreach ($levels as $level) {
if (isset($this->recordsByLevel[$level])) {
$cnt += count($this->recordsByLevel[$level]);
}

0 comments on commit 07d108a

Please sign in to comment.