Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cadbed3

Browse filesBrowse files
author
Harold Iedema
committed
[Console] Log exit codes as debug messages instead of errors
1 parent 267b016 commit cadbed3
Copy full SHA for cadbed3

File tree

2 files changed

+6
-6
lines changed
Filter options

2 files changed

+6
-6
lines changed

‎src/Symfony/Component/Console/EventListener/ErrorListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/EventListener/ErrorListener.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ public function onConsoleTerminate(ConsoleTerminateEvent $event)
5959
}
6060

6161
if (!$inputString = $this->getInputString($event)) {
62-
return $this->logger->error('The console exited with code "{code}"', array('code' => $exitCode));
62+
return $this->logger->debug('The console exited with code "{code}"', array('code' => $exitCode));
6363
}
6464

65-
$this->logger->error('Command "{command}" exited with code "{code}"', array('command' => $inputString, 'code' => $exitCode));
65+
$this->logger->debug('Command "{command}" exited with code "{code}"', array('command' => $inputString, 'code' => $exitCode));
6666
}
6767

6868
public static function getSubscribedEvents()

‎src/Symfony/Component/Console/Tests/EventListener/ErrorListenerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/EventListener/ErrorListenerTest.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testOnConsoleTerminateForNonZeroExitCodeWritesToLog()
6161
$logger = $this->getLogger();
6262
$logger
6363
->expects($this->once())
64-
->method('error')
64+
->method('debug')
6565
->with('Command "{command}" exited with code "{code}"', array('command' => 'test:run', 'code' => 255))
6666
;
6767

@@ -74,7 +74,7 @@ public function testOnConsoleTerminateForZeroExitCodeDoesNotWriteToLog()
7474
$logger = $this->getLogger();
7575
$logger
7676
->expects($this->never())
77-
->method('error')
77+
->method('debug')
7878
;
7979

8080
$listener = new ErrorListener($logger);
@@ -97,7 +97,7 @@ public function testAllKindsOfInputCanBeLogged()
9797
$logger = $this->getLogger();
9898
$logger
9999
->expects($this->exactly(3))
100-
->method('error')
100+
->method('debug')
101101
->with('Command "{command}" exited with code "{code}"', array('command' => 'test:run --foo=bar', 'code' => 255))
102102
;
103103

@@ -112,7 +112,7 @@ public function testCommandNameIsDisplayedForNonStringableInput()
112112
$logger = $this->getLogger();
113113
$logger
114114
->expects($this->once())
115-
->method('error')
115+
->method('debug')
116116
->with('Command "{command}" exited with code "{code}"', array('command' => 'test:run', 'code' => 255))
117117
;
118118

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.