1 | <?php |
||
13 | class CommandNameFormatter implements Formatter |
||
14 | { |
||
15 | /** |
||
16 | * @var CommandNameExtractor |
||
17 | */ |
||
18 | private $commandNameExtractor; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $commandReceivedLevel; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $commandSucceededLevel; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $commandFailedLevel; |
||
34 | |||
35 | /** |
||
36 | * @param string $commandReceivedLevel |
||
37 | * @param string $commandSucceededLevel |
||
38 | * @param string $commandFailedLevel |
||
39 | */ |
||
40 | public function __construct( |
||
51 | |||
52 | /** |
||
53 | * Get the extracted command name |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | private function getCommandName($command) |
||
61 | |||
62 | /** |
||
63 | * {@inheritDoc} |
||
64 | */ |
||
65 | public function logCommandReceived(LoggerInterface $logger, $command) |
||
73 | |||
74 | /** |
||
75 | * {@inheritDoc} |
||
76 | */ |
||
77 | public function logCommandSucceeded(LoggerInterface $logger, $command, $returnValue) |
||
85 | |||
86 | /** |
||
87 | * {@inheritDoc} |
||
88 | */ |
||
89 | public function logCommandFailed(LoggerInterface $logger, $command, Exception $e) |
||
97 | } |
||
98 |