https://github.com/cosium/annotation-processor-logger
A dedicated annotation processor SLF4J implementation which delegates logging to javax Messager
https://github.com/cosium/annotation-processor-logger
Last synced: 9 months ago
JSON representation
A dedicated annotation processor SLF4J implementation which delegates logging to javax Messager
- Host: GitHub
- URL: https://github.com/cosium/annotation-processor-logger
- Owner: Cosium
- License: mit
- Created: 2018-08-09T17:01:08.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-02-18T08:39:30.000Z (over 1 year ago)
- Last Synced: 2025-09-17T16:22:32.867Z (9 months ago)
- Language: Java
- Homepage:
- Size: 34.2 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.cosium.logging%22%20AND%20a%3A%22annotation-processor-logger%22)
# 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
```xml
com.cosium.logging
annotation-processor-logger
${annotation-processor-logger.version}
```
2. Make your `javax.annotation.processing.Processor` extend `com.cosium.logging.annotation_processor.AbstractLoggingProcessor`
```java
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`
```xml
org.apache.maven.plugins
maven-compiler-plugin
true
```