[Console] Log exit codes as debug messages instead of errors

This commit is contained in:
Harold Iedema 2017-08-08 12:48:54 +02:00
parent 267b016415
commit cadbed301f
2 changed files with 6 additions and 6 deletions

View File

@ -59,10 +59,10 @@ class ErrorListener implements EventSubscriberInterface
}
if (!$inputString = $this->getInputString($event)) {
return $this->logger->error('The console exited with code "{code}"', array('code' => $exitCode));
return $this->logger->debug('The console exited with code "{code}"', array('code' => $exitCode));
}
$this->logger->error('Command "{command}" exited with code "{code}"', array('command' => $inputString, 'code' => $exitCode));
$this->logger->debug('Command "{command}" exited with code "{code}"', array('command' => $inputString, 'code' => $exitCode));
}
public static function getSubscribedEvents()

View File

@ -61,7 +61,7 @@ class ErrorListenerTest extends TestCase
$logger = $this->getLogger();
$logger
->expects($this->once())
->method('error')
->method('debug')
->with('Command "{command}" exited with code "{code}"', array('command' => 'test:run', 'code' => 255))
;
@ -74,7 +74,7 @@ class ErrorListenerTest extends TestCase
$logger = $this->getLogger();
$logger
->expects($this->never())
->method('error')
->method('debug')
;
$listener = new ErrorListener($logger);
@ -97,7 +97,7 @@ class ErrorListenerTest extends TestCase
$logger = $this->getLogger();
$logger
->expects($this->exactly(3))
->method('error')
->method('debug')
->with('Command "{command}" exited with code "{code}"', array('command' => 'test:run --foo=bar', 'code' => 255))
;
@ -112,7 +112,7 @@ class ErrorListenerTest extends TestCase
$logger = $this->getLogger();
$logger
->expects($this->once())
->method('error')
->method('debug')
->with('Command "{command}" exited with code "{code}"', array('command' => 'test:run', 'code' => 255))
;