-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use log4j-api instead of slf4j for internal logging, split utility.lo…
…gging
- Loading branch information
Showing
37 changed files
with
271 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
utility-logging/src/main/java/com/dua3/utility/logging/LogLevel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.dua3.utility.logging; | ||
|
||
import com.dua3.utility.data.Color; | ||
import com.dua3.utility.io.AnsiCode; | ||
|
||
public enum LogLevel { | ||
TRACE(AnsiCode.fg(Color.DARKGRAY), AnsiCode.reset()), | ||
DEBUG(AnsiCode.fg(Color.BLACK), AnsiCode.reset()), | ||
INFO(AnsiCode.fg(Color.BLUE), AnsiCode.reset()), | ||
WARN(AnsiCode.fg(Color.ORANGERED), AnsiCode.reset()), | ||
ERROR(AnsiCode.fg(Color.DARKRED), AnsiCode.reset()); | ||
|
||
LogLevel(String escStart, String escEnd) { | ||
this.escStart = escStart; | ||
this.escEnd = escEnd; | ||
} | ||
|
||
String escStart; | ||
String escEnd; | ||
|
||
String colorize(String text, boolean colored) { | ||
return colored ? escStart+text+escEnd : text; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
utility-logging/src/main/resources/META-INF/services/org.slf4j.spi.SLF4JServiceProvider
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
description = "Java utilities (logging)" | ||
|
||
dependencies { | ||
implementation(project(":utility")) | ||
implementation(rootProject.libs.slf4j.api) | ||
api(project(":utility-logging")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.