Skip to content

Commit

Permalink
elf4j spi version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
q3769 committed Mar 20, 2023
1 parent 8a33682 commit 15d69f8
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 68 deletions.
54 changes: 27 additions & 27 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,38 +39,38 @@ jobs:
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish to OSSRH for Maven Central
- name: Publish to OSSRH
run: mvn --batch-mode deploy -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
# - name: Update dependency graph
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<groupId>io.github.elf4j</groupId>
<artifactId>elf4j-tinylog</artifactId>
<version>11.0.4</version>
<version>11.0.5</version>

<packaging>jar</packaging>
<name>elf4j-tinylog</name>
Expand Down Expand Up @@ -67,7 +67,7 @@
<dependency>
<groupId>io.github.elf4j</groupId>
<artifactId>elf4j</artifactId>
<version>2.0.6</version>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.tinylog</groupId>
Expand Down
34 changes: 5 additions & 29 deletions src/main/java/elf4j/tinylog/TinylogLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,28 +115,11 @@ private static org.tinylog.Level translate(Level elf4jLevel) {
}

@Override
public Logger atDebug() {
return atLevel(DEBUG);
}

@Override
public Logger atError() {
return atLevel(ERROR);
}

@Override
public Logger atInfo() {
return atLevel(INFO);
}

@Override
public Logger atTrace() {
return atLevel(TRACE);
}

@Override
public Logger atWarn() {
return atLevel(WARN);
public Logger atLevel(Level level) {
if (this.level == level) {
return this;
}
return LOGGER_CACHE.get(level).computeIfAbsent(this.callerClassName, key -> new TinylogLogger(key, level));
}

@Override
Expand Down Expand Up @@ -179,13 +162,6 @@ public void log(Throwable t, String message, Object... args) {
return callerClassName;
}

private Logger atLevel(Level level) {
if (this.level == level) {
return this;
}
return LOGGER_CACHE.get(level).computeIfAbsent(this.callerClassName, key -> new TinylogLogger(key, level));
}

private void tinylog(@Nullable final Throwable exception,
@Nullable final Object message,
@Nullable final Object[] args) {
Expand Down

0 comments on commit 15d69f8

Please sign in to comment.