Skip to content

[MonologBridge] Ignore empty context/extra by default in the ConsoleFormatter #11496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"doctrine/dbal": "~2.2",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "~1.2",
"monolog/monolog": "~1.3",
"monolog/monolog": "~1.11",
"propel/propel1": "1.6.*",
"ircmaxell/password-compat": "1.0.*",
"ocramius/proxy-manager": ">=0.3.1,<0.6-dev",
Expand Down
8 changes: 8 additions & 0 deletions src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ class ConsoleFormatter extends LineFormatter
{
const SIMPLE_FORMAT = "%start_tag%[%datetime%] %channel%.%level_name%:%end_tag% %message% %context% %extra%\n";

/**
* {@inheritdoc}
*/
public function __construct($format = null, $dateFormat = null, $allowInlineLineBreaks = false, $ignoreEmptyContextAndExtra = true)
{
parent::__construct($format, $dateFormat, $allowInlineLineBreaks, $ignoreEmptyContextAndExtra);
}

/**
* {@inheritdoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ public function testWritingAndFormatting()
$output
->expects($this->once())
->method('write')
->with('<info>[2013-05-29 16:21:54] app.INFO:</info> My info message [] []'."\n")
->with('<info>[2013-05-29 16:21:54] app.INFO:</info> My info message '."\n")
;

$errorOutput = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
$errorOutput
->expects($this->once())
->method('write')
->with('<error>[2013-05-29 16:21:54] app.ERROR:</error> My error message [] []'."\n")
->with('<error>[2013-05-29 16:21:54] app.ERROR:</error> My error message '."\n")
;

$output
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Monolog/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
],
"require": {
"php": ">=5.3.3",
"monolog/monolog": "~1.3"
"monolog/monolog": "~1.11"
},
"require-dev": {
"symfony/http-kernel": "~2.2",
Expand Down