-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch log from slf4j to java logging
- Loading branch information
Showing
24 changed files
with
242 additions
and
112 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
1 change: 1 addition & 0 deletions
1
app/src/main/resources/cn/navclub/nes4j/app/assets/css/GameHallStyle.css
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package cn.navclub.nes4j.bin.log; | ||
|
||
/** | ||
* Enum all log level | ||
* | ||
* @author <a href="https://github.com/GZYangKui">GZYangKui</a> | ||
*/ | ||
public enum Level { | ||
ALL, | ||
TRACE, | ||
DEBUG, | ||
INFO, | ||
WARN, | ||
ERROR, | ||
FATAL, | ||
OFF | ||
} |
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,42 @@ | ||
package cn.navclub.nes4j.bin.log; | ||
|
||
public interface Logger { | ||
/** | ||
* Output a debug level message | ||
* | ||
* @param msg message content | ||
* @param params message params | ||
*/ | ||
void debug(String msg, Object... params); | ||
|
||
/** | ||
* Output a info level message | ||
* | ||
* @param msg message content | ||
* @param params message params | ||
*/ | ||
void info(String msg, Object... params); | ||
|
||
/** | ||
* Output a warning level message | ||
* | ||
* @param msg message content | ||
* @param params message params | ||
*/ | ||
void warning(String msg, Object... params); | ||
|
||
/** | ||
* Output a fatal level message | ||
* | ||
* @param msg message content | ||
* @param throwable exception detail | ||
*/ | ||
void fatal(String msg, Throwable throwable); | ||
|
||
/** | ||
* Whether debug is enable | ||
* | ||
* @return If debug is enable return {@code true} otherwise {@code false} | ||
*/ | ||
boolean isDebugEnabled(); | ||
} |
20 changes: 20 additions & 0 deletions
20
bin/src/main/java/cn/navclub/nes4j/bin/log/LoggerAdapter.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,20 @@ | ||
package cn.navclub.nes4j.bin.log; | ||
|
||
import cn.navclub.nes4j.bin.log.impl.NLogger; | ||
|
||
public class LoggerAdapter { | ||
private static final Level level; | ||
|
||
static { | ||
var str = System.getProperty("nes4j.log.level"); | ||
if (str == null || str.trim().equals("")) { | ||
level = Level.INFO; | ||
} else { | ||
level = Level.valueOf(str.toUpperCase()); | ||
} | ||
} | ||
|
||
public static Logger logger(Class<?> clazz) { | ||
return new NLogger(clazz, level); | ||
} | ||
} |
Oops, something went wrong.