10000 [HttpKernel] Added the context in the LoggerInterface · brki/symfony@410b3e0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 410b3e0

Browse files
committed
[HttpKernel] Added the context in the LoggerInterface
1 parent 627a7f7 commit 410b3e0

File tree

5 files changed

+26
-24
lines changed

5 files changed

+26
-24
lines changed

src/Symfony/Bridge/Monolog/Handler/DebugHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function getLogs()
3434
'message' => $record['message'],
3535
'priority' => $record['level'],
3636
'priorityName' => $record['level_name'],
37+
'context' => $record['context'],
3738
);
3839
}
3940

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ interface DebugLoggerInterface
2323
*
2424
* A log is an array with the following mandatory keys:
2525
* timestamp, message, priority, and priorityName.
26+
* It can also have an optionnal context key containing an array.
2627
*
2728
* @return array An array of logs
2829
*/

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818
*/
1919
interface LoggerInterface
2020
{
21-
function emerg($message);
21+
function emerg($message, array $context = array());
2222

23-
function alert($message);
23+
function alert($message, array $context = array());
2424

25-
function crit($message);
25+
function crit($message, array $context = array());
2626

27-
function err($message);
27+
function err($message, array $context = array());
2828

29-
function warn($message);
29+
function warn($message, array $context = array());
3030

31-
function notice($message);
31+
function notice($message, array $context = array());
3232

33-
function info($message);
33+
function info($message, array $context = array());
3434

35-
function debug($message);
35+
function debug($message, array $context = array());
3636
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
*/
2121
class NullLogger implements LoggerInterface
2222
{
23-
public function emerg($message) {}
23+
public function emerg($message, array $context = array()) {}
2424

25-
public function alert($message) {}
25+
public function alert($message, array $context = array()) {}
2626

27-
public function crit($message) {}
27+
public function crit($message, array $context = array()) {}
2828

29-
public function err($message) {}
29+
public function err($message, array $context = array()) {}
3030

31-
public function warn($message) {}
31+
public function warn($message, array $context = array()) {}
3232

33-
public function notice($message) {}
33+
public function notice($message, array $context = array()) {}
3434

35-
public function info($message) {}
35+
public function info($message, array $context = array()) {}
3636

37-
public function debug($message) {}
37+
public function debug($message, array $context = array()) {}
3838
}

tests/Symfony/Tests/Component/HttpKernel/Logger.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,42 +46,42 @@ public function log($message, $priority)
4646
$this->logs[$priority][] = $message;
4747
}
4848

49-
public function emerg($message)
49+
public function emerg($message, array $context = array())
5050
{
5151
$this->log($message, 'emerg');
5252
}
5353

54-
public function alert($message)
54+
public function alert($message, array $context = array())
5555
{
5656
$this->log($message, 'alert');
5757
}
5858

59-
public function crit($message)
59+
public function crit($message, array $context = array())
6060
{
6161
$this->log($message, 'crit');
6262
}
6363

64-
public function err($message)
64+
public function err($message, array $context = array())
6565
{
6666
$this->log($message, 'err');
6767
}
6868

69-
public function warn($message)
69+
public function warn($message, array $context = array())
7070
{
7171
$this->log($message, 'warn');
7272
}
7373

74-
public function notice($message)
74+
public function notice($message, array $context = array())
7575
{
7676
$this->log($message, 'notice');
7777
}
7878

79-
public function info($message)
79+
public function info($message, array $context = array())
8080
{
8181
$this->log($message, 'info');
8282
}
8383

84-
public function debug($message)
84+
public function debug($message, array $context = array())
8585
{
8686
$this->log($message, 'debug');
8787
}

0 commit comments

Comments
 (0)
0