// +---------------------------------------------------------------------- declare (strict_types=1); namespace crmeb\utils; use think\contract\LogHandlerInterface; use think\facade\Log; /** * 本地化调试输出到文件 */ class SqlLogHandle implements LogHandlerInterface { /** * 日志写入接口 * @access public * @param array $log 日志信息 * @return bool */ public function save(array $log): bool { $logArray = array_chunk($log['sql'], 10); foreach ($logArray as $array) { // Log::write('sql', 'info', $array); Log::write('sql', 'info'); // Logger::getLogger()->system(false)->info('SqlLogHandle', $array); } return true; } }