public function writeLogSections($section, $data, $file = '', $line = '', $matchKey = null)
    {
        if (!is_array($this->Profiler->log_sections)) {
            $this->Profiler->log_sections = [];
        }

        if (!array_key_exists($section, $this->Profiler->log_sections)) {
            // if section is not exists in the key means it was not registered, get out of this function.
            return ;
        }

        if (!is_string($matchKey)) {
            $matchKey = null;
        }

        if ($section == 'Logs') {
            if (is_array($data) && array_key_exists('logtype', $data) && array_key_exists('data', $data)) {
                $logtype = $data['logtype'];
                $data = $data['data'];
            }
        }

        $section_data_array = [
            'data' => $data,
            'file' => $file,
            'line' => $line,
        ];
        if ($matchKey !== null) {
            $section_data_array['matchKey'] = $matchKey;
        }
        if ($section == 'Time Load') {
            $section_data_array['time'] = $this->Profiler->getMicrotime();
        }
        if ($section == 'Memory Usage') {
            $section_data_array['memory'] = memory_get_usage();
        }

        if (isset($logtype)) {
            $section_data_array['logtype'] = $logtype;
        }

        $this->Profiler->log_sections[$section][] = $section_data_array;
        unset($section_data_array);
    }