Skip to content

Commit bfc5c06

Browse files
committed
minor #12699 Hackday deprecated 12621 (arnaugm)
This PR was squashed before being merged into the 2.7 branch (closes #12699). Discussion ---------- Hackday deprecated 12621 | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #12621 | License | MIT | Doc PR | - [MonologBridge] added the deprecated error trigger in the monolog logger emerg(), crit(), err() and warn() methods [HttpKernel] added the deprecated error trigger in the NullLogger emerg(), crit(), err() and warn() methods Commits ------- 88b9500 Hackday deprecated 12621
2 parents 445fabd + 88b9500 commit bfc5c06

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Symfony/Bridge/Monolog/Logger.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class Logger extends BaseLogger implements LoggerInterface, DebugLoggerInterface
2727
*/
2828
public function emerg($message, array $context = array())
2929
{
30+
trigger_error('The emerg() method of the Monolog Logger was removed. You should use the new method emergency() instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
31+
3032
return parent::addRecord(BaseLogger::EMERGENCY, $message, $context);
3133
}
3234

@@ -35,6 +37,8 @@ public function emerg($message, array $context = array())
3537
*/
3638
public function crit($message, array $context = array())
3739
{
40+
trigger_error('The crit() method of the Monolog Logger was removed. You should use the new method critical() instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
41+
3842
return parent::addRecord(BaseLogger::CRITICAL, $message, $context);
3943
}
4044

@@ -43,6 +47,8 @@ public function crit($message, array $context = array())
4347
*/
4448
public function err($message, array $context = array())
4549
{
50+
trigger_error('The err() method of the Monolog Logger was removed. You should use the new method error() instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
51+
4652
return parent::addRecord(BaseLogger::ERROR, $message, $context);
4753
}
4854

@@ -51,6 +57,8 @@ public function err($message, array $context = array())
5157
*/
5258
public function warn($message, array $context = array())
5359
{
60+
trigger_error('The warn() method of the Monolog Logger was removed. You should use the new method warning() instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
61+
5462
return parent::addRecord(BaseLogger::WARNING, $message, $context);
5563
}
5664

src/Symfony/Component/HttpKernel/Log/NullLogger.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class NullLogger extends PsrNullLogger implements LoggerInterface
2828
*/
2929
public function emerg($message, array $context = array())
3030
{
31+
trigger_error('The emerg() method of the NullLogger was removed. You should use the new method emergency() instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
3132
}
3233

3334
/**
@@ -36,6 +37,7 @@ public function emerg($message, array $context = array())
3637
*/
3738
public function crit($message, array $context = array())
3839
{
40+
trigger_error('The crit() method of the NullLogger was removed. You should use the new method critical() instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
3941
}
4042

4143
/**
@@ -44,6 +46,7 @@ public function crit($message, array $context = array())
4446
*/
4547
public function err($message, array $context = array())
4648
{
49+
trigger_error('The err() method of the NullLogger was removed. You should use the new method error() instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
4750
}
4851

4952
/**
@@ -52,5 +55,6 @@ public function err($message, array $context = array())
5255
*/
5356
public function warn($message, array $context = array())
5457
{
58+
trigger_error('The warn() method of the NullLogger was removed. You should use the new method warning() instead, which is PSR-3 compatible.', E_USER_DEPRECATED);
5559
}
5660
}

0 commit comments

Comments
 (0)