<commit_before>package gov.tna.discovery.taxonomy.config;

import java.util.Map.Entry;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.ui.ModelMap;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.context.request.WebRequestInterceptor;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.handler.DispatcherServletWebRequest;
import org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter;

@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {

    public class LogRequestInterceptor implements WebRequestInterceptor {
	private Logger logger = LoggerFactory.getLogger(LogRequestInterceptor.class);

	@Override
	public void preHandle(WebRequest pRrequest) throws Exception {
	    DispatcherServletWebRequest request = (DispatcherServletWebRequest) pRrequest;
	    logger.info("WS > {}", request.getRequest().getRequestURI());
	    for (Entry<String, String[]> parameter : request.getParameterMap().entrySet()) {
		logger.info("Parameter: {} = {}", parameter.getKey(), parameter.getValue());
	    }

	}

	@Override
	public void postHandle(WebRequest pRrequest, ModelMap model) throws Exception {
	    DispatcherServletWebRequest request = (DispatcherServletWebRequest) pRrequest;
	    logger.info("WS > {}", request.getRequest().getRequestURI());
	    for (Entry<String, Object> parameter : model.entrySet()) {
		logger.info("Parameter: {} = {}", parameter.getKey(), parameter.getValue());
	    }
	}

	@Override
	public void afterCompletion(WebRequest request, Exception ex) throws Exception {
	    // TODO Auto-generated method stub

	}

    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
	WebRequestInterceptor logRequestInterceptor = new LogRequestInterceptor();
	registry.addInterceptor(new WebRequestHandlerInterceptorAdapter(logRequestInterceptor));
    }

}
<commit_msg>commented not ready configuration: to log input/output in AOP<commit_after>package gov.tna.discovery.taxonomy.config;

import java.util.Map.Entry;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.ui.ModelMap;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.context.request.WebRequestInterceptor;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.handler.DispatcherServletWebRequest;
import org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter;

//FIXME Log input/output of methods/ws endpoints generically with that class
//@Configuration
//@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {

    public class LogRequestInterceptor implements WebRequestInterceptor {
	private Logger logger = LoggerFactory.getLogger(LogRequestInterceptor.class);

	@Override
	public void preHandle(WebRequest pRrequest) throws Exception {
	    DispatcherServletWebRequest request = (DispatcherServletWebRequest) pRrequest;
	    logger.info("WS > {}", request.getRequest().getRequestURI());
	    for (Entry<String, String[]> parameter : request.getParameterMap().entrySet()) {
		logger.info("Parameter: {} = {}", parameter.getKey(), parameter.getValue());
	    }

	}

	@Override
	public void postHandle(WebRequest pRrequest, ModelMap model) throws Exception {
	    DispatcherServletWebRequest request = (DispatcherServletWebRequest) pRrequest;
	    logger.info("WS > {}", request.getRequest().getRequestURI());
	    for (Entry<String, Object> parameter : model.entrySet()) {
		logger.info("Parameter: {} = {}", parameter.getKey(), parameter.getValue());
	    }
	}

	@Override
	public void afterCompletion(WebRequest request, Exception ex) throws Exception {
	    // TODO Auto-generated method stub

	}

    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
	WebRequestInterceptor logRequestInterceptor = new LogRequestInterceptor();
	registry.addInterceptor(new WebRequestHandlerInterceptorAdapter(logRequestInterceptor));
    }

}

{'fraction_non_alphanumeric': 0.10120481927710843, 'fraction_numerical': 0.0008762322015334064, 'mean_word_length': 5.981651376146789, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '419145', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1181, 'n_words': 238}