Skip to content

A dedicated annotation processor SLF4J implementation which delegates logging to javax Messager

License

Notifications You must be signed in to change notification settings

Cosium/annotation-processor-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maven Central Latest

Annotation processor logger

A dedicated annotation processor SLF4J implementation which delegates logging to javax.annotation.processing.Messager.

Usage

  1. Add the dependency to your annotation processor project

    <dependency>
      <groupId>com.cosium.logging</groupId>
      <artifactId>annotation-processor-logger</artifactId>
      <version>${annotation-processor-logger.version}</version>
    </dependency>
  2. Make your javax.annotation.processing.Processor extend com.cosium.logging.annotation_processor.AbstractLoggingProcessor

    public class MyProcessor extends AbstractLoggingProcessor {
        protected boolean doProcess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
            // Make the world a better place
        }
    }
  3. Use SLF4J as usual

Enabling all logging levels

Maven

In the Maven project using your annotation processor, enable showWarnings in maven-compiler-plugin

<build>
  <plugins>
    <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-compiler-plugin</artifactId>
       <configuration>
         <showWarnings>true</showWarnings>
       </configuration>
    </plugin>
  </plugins>
</build>

About

A dedicated annotation processor SLF4J implementation which delegates logging to javax Messager

Resources

License

Stars

Watchers

Forks

Packages

No packages published