Skip to content

Commit

Permalink
Avoid logger being set multiple times.
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenlj committed May 26, 2021
1 parent dc54172 commit 04f10d3
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ public static void setLoggerAdapter(String loggerAdapter) {
*/
public static void setLoggerAdapter(LoggerAdapter loggerAdapter) {
if (loggerAdapter != null) {
if (loggerAdapter == LOGGER_ADAPTER) {
return;
}
Logger logger = loggerAdapter.getLogger(LoggerFactory.class.getName());
logger.info("using logger: " + loggerAdapter.getClass().getName());
LoggerFactory.LOGGER_ADAPTER = loggerAdapter;
Expand Down

0 comments on commit 04f10d3

Please sign in to comment.