Formatter
in
Converts incoming Commands into log messages.
Each method is written for a particular command path. A formatter class should take the given command, format it to a message and pass it to the given logger (with the desired log level).
For an example of what this all looks like, take a look at the ClassNameFormatter example bundled with this package.
A formatter may also use PSR-3 log contexts to pass extra info to the logger about the commands, return values and errors it receives. For more information about log contexts, see the PSR-3 specification.
Tags
Table of Contents
- logCommandFailed() : void
- logCommandReceived() : void
- logCommandSucceeded() : void
Methods
logCommandFailed()
public
logCommandFailed(LoggerInterface $logger, object $command, Exception $e) : void
Parameters
- $logger : LoggerInterface
- $command : object
- $e : Exception
Return values
void —logCommandReceived()
public
logCommandReceived(LoggerInterface $logger, object $command) : void
Parameters
- $logger : LoggerInterface
- $command : object
Return values
void —logCommandSucceeded()
public
logCommandSucceeded(LoggerInterface $logger, object $command, mixed $returnValue) : void
Parameters
- $logger : LoggerInterface
- $command : object
- $returnValue : mixed