code: public function onLog(Event $event)
      {
          if (!$this->fileHandle) {
              return;
          }
          $method = $event['method'];
          if ($method == 'groupUncollapse') {
              return;
          }
          $args = $event['args'];
          $meta = $event['meta'];
          $isSummaryBookend = $method == 'groupSummary' || !empty($meta['closesSummary']);
          if ($isSummaryBookend) {
              \fwrite($this->fileHandle, "=========\n");
              return;
          }
          if ($args) {
              $str = $this->processLogEntryWEvent($method, $args, $meta);
              \fwrite($this->fileHandle, $str);
          } elseif ($method == 'groupEnd' && $this->depth > 0) {
              $this->depth --;
          }
      }
docs: debug.log event subscriber
  
  @param Event $event debug.log event object
  
  @return void