Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitcadbed3

Browse files
author
Harold Iedema
committed
[Console] Log exit codes as debug messages instead of errors
1 parent267b016 commitcadbed3

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines 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
publicstaticfunctiongetSubscribedEvents()

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

Lines 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 =newErrorListener($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)

[8]ページ先頭

©2009-2025 Movatter.jp