Skip to content

Commit 2b65b23

Browse files
committed
[symfony#3322] Minor tweaks to facelift for console logging entry
1 parent 1e84cb0 commit 2b65b23

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cookbook/console/logging.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,10 @@ Then implement the actual listener::
139139
namespace Acme\DemoBundle\EventListener;
140140

141141
use Symfony\Component\Console\Event\ConsoleExceptionEvent;
142-
use \Psr\Log\LoggerInterface;
142+
use Psr\Log\LoggerInterface;
143143

144144
class ConsoleExceptionListener
145145
{
146-
/** @var $logger LoggerInterface */
147146
private $logger;
148147

149148
public function __construct(LoggerInterface $logger)
@@ -168,9 +167,11 @@ Then implement the actual listener::
168167
}
169168
}
170169

171-
In the code above, when a command throws an exception, the listener will
170+
In the code above, when any command throws an exception, the listener will
172171
receive an event. You can simply log it by passing the logger service via the
173-
service configuration.
172+
service configuration. Your method receives a
173+
:class:`Symfony\\Component\\Console\\Event\\ConsoleExceptionEvent`` object,
174+
which has methods to get information about the event and the exception.
174175

175176
Logging non-0 exit statuses
176177
---------------------------
@@ -243,11 +244,10 @@ Then implement the actual listener::
243244
namespace Acme/DemoBundle\EventListener;
244245

245246
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
246-
use \Psr\Log\LoggerInterface;
247+
use Psr\Log\LoggerInterface;
247248

248249
class ConsoleTerminateListener
249250
{
250-
/** @var $logger LoggerInterface */
251251
private $logger;
252252

253253
public function __construct(LoggerInterface $logger)

0 commit comments

Comments
 (0)