Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Logging enabled check idea

Would this do the trick ?
It will for sure hit regarding to the pointcut, but not quite shure if
it will actually save the construction of the string.

public class LoggingAspect {
   @Around("call (* Logger.debug(..)) && target(log) &&
   public void isDebugEnabled(ProceedingJoinPoint thisJoinPoint,
Logger log) throws Throwable {
       if (log.isDebugEnabled()) {

/Kaare Nilsen

On 06/06/06, Wim Deblauwe <wim.deblauwe@xxxxxxxxx> wrote:

I just had this idea for the use of aspectj, but I don't know if it is

Most of you know that they can check if logging is enabled before putting
the log statement in their code, however, very few do this because it
clutters the code. Would it be possible to define an aspect that adds all
those checks in there (with log4j and/or commons-logging)?

Just an idea if someone has some time to spare :)



aspectj-users mailing list

Back to the top