List of usage examples for org.aspectj.bridge IMessage DEBUG
Kind DEBUG
To view the source code for org.aspectj.bridge IMessage DEBUG.
Click Source Link
From source file:AjcCompiler.java
License:Open Source License
/** * Hook into the maven logger.//from ww w .j a v a 2 s.c om */ public boolean handleMessage(IMessage message) { if (message.getKind().equals(IMessage.WARNING) && !isIgnoring(IMessage.WARNING)) log.warning(message.getMessage()); else if (message.getKind().equals(IMessage.DEBUG) && !isIgnoring(IMessage.DEBUG)) log.fine(message.getMessage()); else if (message.getKind().equals(IMessage.ERROR) && !isIgnoring(IMessage.ERROR)) log.severe(message.getMessage()); else if (message.getKind().equals(IMessage.ABORT) && !isIgnoring(IMessage.ABORT)) log.severe(message.getMessage()); else if (message.getKind().equals(IMessage.FAIL) && !isIgnoring(IMessage.FAIL)) log.severe(message.getMessage()); else if (message.getKind().equals(IMessage.INFO) && !isIgnoring(IMessage.INFO)) log.fine(message.getMessage()); else if (message.getKind().equals(IMessage.WEAVEINFO) && !isIgnoring(IMessage.WEAVEINFO)) log.info(message.getMessage()); else if (message.getKind().equals(IMessage.TASKTAG) && !isIgnoring(IMessage.TASKTAG)) log.fine(message.getMessage()); return super.handleMessage(message); }
From source file:ataspectj.TestHelper.java
License:Open Source License
public boolean handleMessage(IMessage message) throws AbortException { boolean ret = super.handleMessage(message); if (message.getKind().isSameOrLessThan(IMessage.INFO)) ;/*from w w w. ja va 2 s. c o m*/ if (message.getKind().isSameOrLessThan(IMessage.DEBUG)) ; else { // we do exit here since Assert.fail will only trigger a runtime exception that might // be catched by the weaver anyway System.err.println("*** Exiting - got a warning/fail/error/abort IMessage"); System.exit(-1); } return ret; }
From source file:de.zalando.mojo.aspectj.MavenMessageHandler.java
License:Open Source License
/** * Copies output from the supplied message onto the active Maven Log. * If the message type (i.e. {@code message.getKind()}) is listed in the showDetailsForMessageKindList List, * the message is prefixed with location details (Class, row/line number etc.) as well. * <p/>/* w w w .j av a 2 s .c o m*/ * {@inheritDoc} */ public boolean handleMessage(final IMessage message) { // Compose the message text final StringBuilder builder = new StringBuilder(message.getMessage()); if (isMessageDetailDesired(message)) { // // The AJC details are typically delivered on the format [fileName]:[lineNumber] // (i.e. /src/main/java/Clazz.java:16). // // Mimic this, and include the context of the message as well, // including guarding against NPEs. // final ISourceLocation sourceLocation = message.getSourceLocation(); final String sourceFile = sourceLocation == null || sourceLocation.getSourceFile() == null ? "<unknown source file>" : sourceLocation.getSourceFile().getAbsolutePath(); final String context = sourceLocation == null || sourceLocation.getContext() == null ? "" : sourceLocation.getContext() + "\n"; final String line = sourceLocation == null ? "<no line information>" : "" + sourceLocation.getLine(); builder.append("\n\t").append(sourceFile).append(":").append(line).append("\n").append(context); } final String messageText = builder.toString(); if (isNotIgnored(message, IMessage.DEBUG) || isNotIgnored(message, IMessage.INFO) || isNotIgnored(message, IMessage.TASKTAG)) { // The DEBUG, INFO, and TASKTAG ajc message kinds are considered Maven Debug messages. log.debug(messageText); } else if (isNotIgnored(message, IMessage.WEAVEINFO)) { // The WEAVEINFO ajc message kind is considered Maven Info messages. log.info(messageText); } else if (isNotIgnored(message, IMessage.WARNING)) { // The WARNING ajc message kind is considered Maven Warn messages. log.warn(messageText); } else if (isNotIgnored(message, IMessage.ERROR) || isNotIgnored(message, IMessage.ABORT) || isNotIgnored(message, IMessage.FAIL)) { // We map ERROR, ABORT, and FAIL ajc message kinds to Maven Error messages. log.error(messageText); } // Delegate to normal handling. return super.handleMessage(message); }
From source file:info.rubico.mock4aj.weavers.aspectj.DynamicRuntimeWeavingAdaptor.java
License:Open Source License
protected void initMessageHandler() { super.createMessageHandler(); IMessageHandler messageHandler = getMessageHandler(); // TODO Configure verbosity messageHandler.dontIgnore(IMessage.INFO); // VERBOSE messageHandler.dontIgnore(IMessage.DEBUG); messageHandler.dontIgnore(IMessage.WEAVEINFO); }
From source file:org.caesarj.compiler.aspectj.CaesarMessageHandler.java
License:Open Source License
/** * Tells whether the given message kind should be ignored by the handler. *//* w w w.ja va2 s. co m*/ public boolean isIgnoring(Kind kind) { return kind == IMessage.INFO || kind == IMessage.WEAVEINFO || kind == IMessage.DEBUG; }
From source file:org.springframework.aop.aspectj.AspectJWeaverMessageHandler.java
License:Apache License
@Override public boolean handleMessage(IMessage message) throws AbortException { Kind messageKind = message.getKind(); if (messageKind == IMessage.DEBUG) { if (logger.isDebugEnabled()) { logger.debug(makeMessageFor(message)); return true; }/*w w w . j av a2s. com*/ } else if (messageKind == IMessage.INFO || messageKind == IMessage.WEAVEINFO) { if (logger.isInfoEnabled()) { logger.info(makeMessageFor(message)); return true; } } else if (messageKind == IMessage.WARNING) { if (logger.isWarnEnabled()) { logger.warn(makeMessageFor(message)); return true; } } else if (messageKind == IMessage.ERROR) { if (logger.isErrorEnabled()) { logger.error(makeMessageFor(message)); return true; } } else if (messageKind == IMessage.ABORT) { if (logger.isFatalEnabled()) { logger.fatal(makeMessageFor(message)); return true; } } return false; }