1 | <?php |
||
33 | class SymfonyConsoleLog implements EventSubscriberInterface |
||
34 | { |
||
35 | // Use traits to aid in output |
||
36 | use BytesToHumanTrait; |
||
37 | use TimeFormatterTrait; |
||
38 | |||
39 | // -------------------------------------------------------------- |
||
40 | |||
41 | /** |
||
42 | * @var OutputInterface |
||
43 | */ |
||
44 | private $output; |
||
45 | |||
46 | /** |
||
47 | * @var array |
||
48 | */ |
||
49 | private $linePrefixMap = [ |
||
50 | Tick::SKIP => 'SKIP»', |
||
51 | TICK::SUCCESS => 'SUCC»', |
||
52 | TICK::FAIL => 'FAIL»' |
||
53 | ]; |
||
54 | |||
55 | // -------------------------------------------------------------- |
||
56 | |||
57 | /** |
||
58 | * Constructor |
||
59 | * |
||
60 | * @param OutputInterface $output |
||
61 | */ |
||
62 | public function __construct(OutputInterface $output) |
||
66 | |||
67 | // -------------------------------------------------------------- |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | public static function getSubscribedEvents() |
||
81 | |||
82 | |||
83 | // --------------------------------------------------------------- |
||
84 | |||
85 | /** |
||
86 | * Set line prefix map |
||
87 | * |
||
88 | * @param array $prefixMap [status => 'prefix'] |
||
89 | */ |
||
90 | public function setLinePrefixMap(array $prefixMap) |
||
96 | |||
97 | // --------------------------------------------------------------- |
||
98 | |||
99 | /** |
||
100 | * Set prefix for a given status |
||
101 | * |
||
102 | * @param int $status Tick::SUCCESS, Tick::FAIL, or Tick::SUCCESS |
||
103 | * @param string $prefix |
||
104 | */ |
||
105 | public function setLinePrefix($status, $prefix) |
||
109 | |||
110 | // --------------------------------------------------------------- |
||
111 | |||
112 | /** |
||
113 | * Write Log Line |
||
114 | * |
||
115 | * @param Tick $tick |
||
116 | */ |
||
117 | public function writeLogLine(Tick $tick) |
||
171 | |||
172 | // --------------------------------------------------------------- |
||
173 | |||
174 | /** |
||
175 | * @param Tick $tick |
||
176 | */ |
||
177 | public function writeStartLine(Tick $tick) |
||
181 | |||
182 | /** |
||
183 | * @param Tick $tick |
||
184 | */ |
||
185 | public function writeFinishLine(Tick $tick) |
||
189 | |||
190 | /** |
||
191 | * @param Tick $tick |
||
192 | */ |
||
193 | public function writeAbortLine(Tick $tick) |
||
197 | } |
||
198 |