<commit_before>/*
 * (C) Copyright IBM Corporation 2016
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.ibm.ws.microprofile.sample.conference.vote.utils;

import java.lang.reflect.Method;
import java.util.Arrays;

import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;

@Log
@Interceptor
public class Logger {

	@AroundInvoke
	public Object Log(InvocationContext context) throws Exception {
	    Method method = context.getMethod();
	    String clazz = method.getDeclaringClass().getName();
	    String mthd =  clazz + ":" + method.getName();
     	String parms = Arrays.toString(context.getParameters());
		
		
	       try {
	           Object result = context.proceed();
	           System.out.println( "Call to " + mthd + "(" + parms + ") returned " + result);
	           return result;
	        }
	        catch (Exception e) {
               System.out.println("Call to " + mthd + "(" + parms + ") threw " + e.toString() );
	           throw e;
	        }
	}

}<commit_msg>Added @Priority to Logger.<commit_after>/*
 * (C) Copyright IBM Corporation 2016
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.ibm.ws.microprofile.sample.conference.vote.utils;

import java.lang.reflect.Method;
import java.util.Arrays;
import javax.annotation.Priority;
import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;

@Log
@Interceptor
@Priority(Logger.LOG_INTERCEPTOR_PRIORITY)
public class Logger {

	static final int LOG_INTERCEPTOR_PRIORITY = 100;
	 
	@AroundInvoke
	public Object Log(InvocationContext context) throws Exception {
	    Method method = context.getMethod();
	    String clazz = method.getDeclaringClass().getName();
	    String mthd =  clazz + ":" + method.getName();
     	String parms = Arrays.toString(context.getParameters());
		
		
	       try {
	           Object result = context.proceed();
	           System.out.println( "Call to " + mthd + "(" + parms + ") returned " + result);
	           return result;
	        }
	        catch (Exception e) {
               System.out.println("Call to " + mthd + "(" + parms + ") threw " + e.toString() );
	           throw e;
	        }
	}

}
{'fraction_non_alphanumeric': 0.1020719073735527, 'fraction_numerical': 0.00578915295551493, 'mean_word_length': 3.1243718592964824, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4829948', 'n_tokens_mistral': 945, 'n_tokens_neox': 886, 'n_words': 301}