<commit_before>package com.ponkotuy.proxy

import java.net.InetSocketAddress
import javax.net.ssl.SSLSession

import io.netty.handler.codec.http.{HttpRequest,HttpResponse}

import org.littleshoot.proxy._

import org.slf4j.Logger
import org.slf4j.LoggerFactory

class LoggingActivityTracker extends ActivityTrackerAdapter {

  lazy val logger = LoggerFactory.getLogger(getClass)

  override def requestReceivedFromClient(flowContext: FlowContext,httpRequest: HttpRequest): Unit = {
    logger.debug("request received from client to proxy. URL:{}",httpRequest.getUri)
  }

  override def requestSentToServer(flowConext: FullFlowContext,httpRequest: HttpRequest): Unit = {
    logger.debug("request sent proxy to server. URL:{}",httpRequest.getUri)
  }

  override def bytesReceivedFromServer(flowConext: FullFlowContext,numberOfBytes: Int): Unit = {
    logger.trace("response received from server to proxy. {} bytes",numberOfBytes);
  }

  override def responseReceivedFromServer(flowContext: FullFlowContext,httpResponse: HttpResponse): Unit = {
    logger.debug("response received from server to proxy. STATUS:{}",httpResponse.getStatus);
  }

  override def responseSentToClient(flowContext: FlowContext,httpResponse: HttpResponse): Unit = {
    logger.debug("response sent to client from proxy. STATUS:{}",httpResponse.getStatus);
  }

  override def clientConnected(clientAddress: InetSocketAddress): Unit = {
    logger.info("Client Connected from:{}",clientAddress.toString);
  }

  override def clientDisconnected(clientAddress: InetSocketAddress,sslSession: SSLSession): Unit = {
    logger.info("Client DisConnected from:{}",clientAddress.toString)
  }
}

<commit_msg>Response の Log 情報を追加。<commit_after>package com.ponkotuy.proxy

import java.net.InetSocketAddress
import javax.net.ssl.SSLSession

import io.netty.handler.codec.http.{HttpRequest,HttpResponse}
import io.netty.handler.codec.http.HttpHeaders

import org.littleshoot.proxy._

import org.slf4j.Logger
import org.slf4j.LoggerFactory

class LoggingActivityTracker extends ActivityTrackerAdapter {

  lazy val logger = LoggerFactory.getLogger(getClass)

  override def requestReceivedFromClient(flowContext: FlowContext,httpRequest: HttpRequest): Unit = {
    logger.debug("request received from client to proxy. URL:{}",httpRequest.getUri)
  }

  override def requestSentToServer(flowConext: FullFlowContext,httpRequest: HttpRequest): Unit = {
    logger.debug("request sent proxy to server. URL:{}",httpRequest.getUri)
  }

  override def bytesReceivedFromServer(flowConext: FullFlowContext,numberOfBytes: Int): Unit = {
    logger.trace("response received from server to proxy. {} bytes",numberOfBytes)
  }

  override def responseReceivedFromServer(flowContext: FullFlowContext,httpResponse: HttpResponse): Unit = {
    logger.debug(
      "response received from server to proxy. Status:{}, Transfer:{}, Content:{}",
      httpResponse.getStatus,
      httpResponse.headers.get(HttpHeaders.Names.TRANSFER_ENCODING),
      httpResponse.headers.get(HttpHeaders.Names.CONTENT_ENCODING)
    )
  }

  override def responseSentToClient(flowContext: FlowContext,httpResponse: HttpResponse): Unit = {
    logger.debug(
      "response sent to client from proxy. Status:{}, Transfer:{}, Content:{}",
      httpResponse.getStatus,
      httpResponse.headers.get(HttpHeaders.Names.TRANSFER_ENCODING),
      httpResponse.headers.get(HttpHeaders.Names.CONTENT_ENCODING)
    )
  }

  override def clientConnected(clientAddress: InetSocketAddress): Unit = {
    logger.info("Client Connected from:{}",clientAddress.toString);
  }

  override def clientDisconnected(clientAddress: InetSocketAddress,sslSession: SSLSession): Unit = {
    logger.info("Client DisConnected from:{}",clientAddress.toString)
  }
}


{'fraction_non_alphanumeric': 0.10217622080679406, 'fraction_numerical': 0.0010615711252653928, 'mean_word_length': 5.5776614310645725, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6440925', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1069, 'n_words': 223}