-
Notifications
You must be signed in to change notification settings - Fork 6
Implement base element and API for customizing RLib Logger #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e8f9285
add bridge slf4j to rlib logger
JavaSaBr caf386b
start working on customizing logger
JavaSaBr b7a6dc6
resolve CR comments
JavaSaBr ab4fafa
resolve CR comments
JavaSaBr 43e01ea
Merge branch 'improve-logger-part-1' into improve-logger-part-2
JavaSaBr d58fc68
Merge remote-tracking branch 'origin/develop' into improve-logger-part-2
JavaSaBr e5b0634
working on customization support for logger system
JavaSaBr fe44dd2
implement base API for customization support of logger engine
JavaSaBr 1ccf4bd
add missed javadoc
JavaSaBr 12794e7
resolve CR comments
JavaSaBr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
31 changes: 31 additions & 0 deletions
31
rlib-logger-api/src/main/java/javasabr/rlib/logger/api/impl/NoOpsLoggerFactory.java
This file contains hidden or 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,31 @@ | ||
| package javasabr.rlib.logger.api.impl; | ||
|
|
||
| import javasabr.rlib.logger.api.Logger; | ||
| import javasabr.rlib.logger.api.LoggerFactory; | ||
| import javasabr.rlib.logger.api.LoggerService; | ||
|
|
||
| public class NoOpsLoggerFactory implements LoggerFactory { | ||
|
|
||
| private static final NoOpsLogger NULL_LOGGER = new NoOpsLogger(); | ||
| private static final LoggerService NO_OPS_LOGGER_SERVICE = new NoOpsLoggerService(); | ||
|
|
||
| @Override | ||
| public Logger getLogger(String name) { | ||
| return NULL_LOGGER; | ||
| } | ||
|
|
||
| @Override | ||
| public Logger getLogger(Class<?> type) { | ||
| return NULL_LOGGER; | ||
| } | ||
|
|
||
| @Override | ||
| public Logger getDefault() { | ||
| return NULL_LOGGER; | ||
| } | ||
|
JavaSaBr marked this conversation as resolved.
Outdated
|
||
|
|
||
| @Override | ||
| public LoggerService getLoggerService() { | ||
| return NO_OPS_LOGGER_SERVICE; | ||
| } | ||
| } | ||
28 changes: 28 additions & 0 deletions
28
rlib-logger-api/src/main/java/javasabr/rlib/logger/api/impl/NoOpsLoggerService.java
This file contains hidden or 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,28 @@ | ||
| package javasabr.rlib.logger.api.impl; | ||
|
|
||
| import javasabr.rlib.logger.api.Logger; | ||
| import javasabr.rlib.logger.api.LoggerLevel; | ||
| import javasabr.rlib.logger.api.LoggerService; | ||
|
|
||
| public class NoOpsLoggerService implements LoggerService { | ||
|
|
||
| @Override | ||
| public void enable(Class<?> cs, LoggerLevel level) {} | ||
|
|
||
| @Override | ||
| public void disable(Class<?> cs, LoggerLevel level) {} | ||
|
|
||
| @Override | ||
| public void configureDefault(LoggerLevel level, boolean def) {} | ||
|
|
||
| @Override | ||
| public void removeDefault(LoggerLevel level) {} | ||
|
|
||
| @Override | ||
| public int enabled(LoggerLevel level) { | ||
| return 0; | ||
| } | ||
|
|
||
| @Override | ||
| public void write(Logger logger, LoggerLevel level, String message) {} | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.