Conditions | 5 |
Paths | 9 |
Total Lines | 21 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function record($resourceLogs) |
||
21 | { |
||
22 | $file = config('stethoscope.log_file_storage.path') . now()->format('Y-m-d'); |
||
23 | |||
24 | $log = ''; |
||
25 | |||
26 | foreach ($resourceLogs as $resource => $report) { |
||
27 | $method = $resource . 'Message'; |
||
28 | |||
29 | if (method_exists($this, $method)) { |
||
30 | $log .= $this->$method($report) . "\n"; |
||
31 | } |
||
32 | } |
||
33 | |||
34 | if ($log != '') { |
||
35 | $log = $this->timeMessage() . "\n" . $log; |
||
36 | |||
37 | if ($this->storage->exists($file)) |
||
38 | $log = $this->storage->get($file) . "\n \n" . $log; |
||
39 | |||
40 | $this->storage->put($file, $log); |
||
41 | } |
||
49 |