| Conditions | 4 |
| Paths | 3 |
| Total Lines | 28 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 35 | public function formatLogConfig($app) |
||
| 36 | { |
||
| 37 | if (!empty($app['config']->get('log.channels'))) { |
||
| 38 | return $app['config']->get('log'); |
||
| 39 | } |
||
| 40 | |||
| 41 | if (empty($app['config']->get('log'))) { |
||
| 42 | return [ |
||
| 43 | 'log' => [ |
||
| 44 | 'default' => 'errorlog', |
||
| 45 | 'channels' => [ |
||
| 46 | 'errorlog' => [ |
||
| 47 | 'driver' => 'errorlog', |
||
| 48 | 'level' => 'debug', |
||
| 49 | ], |
||
| 50 | ], |
||
| 51 | ], |
||
| 52 | ]; |
||
| 53 | } |
||
| 54 | |||
| 55 | return [ |
||
| 56 | 'log' => [ |
||
| 57 | 'default' => 'single', |
||
| 58 | 'channels' => [ |
||
| 59 | 'single' => [ |
||
| 60 | 'driver' => 'single', |
||
| 61 | 'path' => $app['config']->get('log.file') ?: \sys_get_temp_dir().'/logs/EasyIM.log', |
||
| 62 | 'level' => $app['config']->get('log.level', 'debug'), |
||
| 63 | ], |
||
| 69 |