Skip to content

Commit

Permalink
Updating System logger
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiviter committed Jul 21, 2023
1 parent c7daa79 commit bca5ca5
Show file tree
Hide file tree
Showing 22 changed files with 196 additions and 405 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
Expand All @@ -23,4 +23,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >
mvn -B -ntp verify sonar:sonar "-Dsonar.coverage.jacoco.xmlReportPaths=**/target/site/jacoco.xml"
mvn -B -ntp verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar "-Dsonar.coverage.jacoco.xmlReportPaths=**/target/site/jacoco.xml"
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
Expand All @@ -26,7 +26,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B -ntp verify sonar:sonar "-Dsonar.coverage.jacoco.xmlReportPaths=**/target/site/jacoco.xml"
run: mvn -B -ntp verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar "-Dsonar.coverage.jacoco.xmlReportPaths=**/target/site/jacoco.xml"

- name: Publish to Apache Maven Central Snapshot Repo
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
Expand Down
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/dansiviter/jule/Build?style=flat-square)](https://github.com/dansiviter/jule/actions/workflows/build.yaml) [![Known Vulnerabilities](https://snyk.io/test/github/dansiviter/jule/badge.svg?style=flat-square)](https://snyk.io/test/github/dansiviter/jule) [![Sonar Coverage](https://img.shields.io/sonar/coverage/dansiviter_jule?server=https%3A%2F%2Fsonarcloud.io&style=flat-square)](https://sonarcloud.io/dashboard?id=dansiviter_jule) [![Maven Central](https://img.shields.io/maven-central/v/uk.dansiviter.jule/jule-project?style=flat-square)](https://search.maven.org/artifact/uk.dansiviter.jule/jule-project) ![Java 11+](https://img.shields.io/badge/-Java%2011%2B-informational?style=flat-square)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/dansiviter/jule/deploy.yaml)](https://github.com/dansiviter/jule/actions/workflows/build.yaml) [![Known Vulnerabilities](https://snyk.io/test/github/dansiviter/jule/badge.svg?style=flat-square)](https://snyk.io/test/github/dansiviter/jule) [![Sonar Coverage](https://img.shields.io/sonar/coverage/dansiviter_jule?server=https%3A%2F%2Fsonarcloud.io&style=flat-square)](https://sonarcloud.io/dashboard?id=dansiviter_jule) [![Maven Central](https://img.shields.io/maven-central/v/uk.dansiviter.jule/jule-project?style=flat-square)](https://search.maven.org/artifact/uk.dansiviter.jule/jule-project) ![Java 11+](https://img.shields.io/badge/-Java%2011%2B-informational?style=flat-square)


# Java Util Logging Enhancer (JULE) #
Expand Down Expand Up @@ -44,10 +44,10 @@ package com.foo;

@Log
public interface MyLog {
@Message("Hello %s") // <- defaults to `Info` level
@Message("Hello %s") // Uses java.util.Formatter and defaults to `INFO` level
void hello(String name);

@Message(value = "Oh no! %s", level = Level.ERROR) // <- 'Error' level
@Message(value = "Oh no! %s", level =.ERROR) // <- 'ERROR' level
void error(String name, Throwable t); // <- Throwables must be last parameter

@Message("Hello %s")
Expand Down Expand Up @@ -79,16 +79,19 @@ public class MyClass {

## CDI ##

This can perform automatic injection of dependencies via CDI:
Simply create your own factory:

```xml
<dependency>
<groupId>uk.dansiviter.jule</groupId>
<artifactId>cdi</artifactId>
<version>${jule.version}</version>
</dependency>
```java
@ApplicationScoped
public class MyLogFactory {
@Produces @Dependent // Always use dependent scope to prevent proxying
public static MyLog myLog(InjectionPoint ip) {
return LogProducer.log(MyLog.class, ip.getMember().getDeclaringClass());
}
}
```

Then just inject:
```java
@ApplicationScoped
public class MyClass {
Expand Down
60 changes: 0 additions & 60 deletions cdi/pom.xml

This file was deleted.

93 changes: 0 additions & 93 deletions cdi/src/main/java/uk/dansiviter/jule/cdi/LogExtension.java

This file was deleted.

6 changes: 0 additions & 6 deletions cdi/src/main/resources/META-INF/beans.xml

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions cdi/src/test/java/uk/dansiviter/jule/cdi/Log0.java

This file was deleted.

25 changes: 0 additions & 25 deletions cdi/src/test/java/uk/dansiviter/jule/cdi/Log1.java

This file was deleted.

Loading

0 comments on commit bca5ca5

Please sign in to comment.