import java.util.logging.*;
import org.aspectj.lang.*;
import logger.*;

public aspect AspectJLogger {

	pointcut samplePointcut():  within(logger.*) && withincode(* logData(*)) &&  !within(AspectJLogger);
	pointcut samplePointcut1():  withincode(* *..logData(*)) ;
	
	
	pointcut register(): within(logger.LogExample) && execution(public * *(..));
    pointcut canRegister(): withincode(private * logData(*));

    before(): register() && !canRegister() {
    	Signature signature = thisJoinPointStaticPart.getSignature();
    	System.out.println(signature.getDeclaringType().getName());
    	System.out.println(signature.getName());
        //new LogExample().logger.logp(Level.INFO, signature.getDeclaringType().getName(),signature.getName(), "Entering");
    	//LogExample.aspectJLogging(10, signature.getDeclaringType().getName(), signature.getName());
    	//new LogExample().logger.logp(Level.INFO,signature.getDeclaringType().getSimpleName(), signature.getName(), "Entering");
    }

/*	
  	void around():samplePointcut1(){
		//  System.out.println(thisJoinPointStaticPart.getSignature().getDeclaringType().getSimpleName());
		// System.out.println("Method name" + thisJoinPointStaticPart.getSignature().getName());
		 //System.out.println("CALLED");
		 proceed();
	}
*/
}	