Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| LoggerFactory | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| for | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace UppServices; |
| 6 | |
| 7 | use Psr\Log\LoggerInterface; |
| 8 | |
| 9 | /** |
| 10 | * Builds a PSR-3 logger that writes to the legacy log file for the given source file. |
| 11 | * Use for(__FILE__) in your class so logs go to {basename}.log (e.g. DeviceController.php.log). |
| 12 | */ |
| 13 | class LoggerFactory |
| 14 | { |
| 15 | public function for(string $file): LoggerInterface |
| 16 | { |
| 17 | return new LoggerService($file); |
| 18 | } |
| 19 | } |
| 20 | ?> |