Skip to content

Commit

Permalink
rename SLF4JPlarformLogger as SLF4JPlatformLogger
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Aug 30, 2021
1 parent baadb61 commit 1d4535a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,28 @@
import org.slf4j.LoggerFactory;

/**
* Manages instances of {@link SLF4JPlarformLogger}.
* Manages instances of {@link SLF4JPlatformLogger}.
*
* @since 1.3.0
* @author Ceki
*
*/
public class SLF4JPlarformLoggerFactory {
ConcurrentMap<String, SLF4JPlarformLogger> loggerMap = new ConcurrentHashMap<>();
ConcurrentMap<String, SLF4JPlatformLogger> loggerMap = new ConcurrentHashMap<>();

/**
* Return an appropriate {@link SLF4JPlarformLogger} instance by name.
* Return an appropriate {@link SLF4JPlatformLogger} instance by name.
*/
public SLF4JPlarformLogger getLogger(String loggerName) {
public SLF4JPlatformLogger getLogger(String loggerName) {


SLF4JPlarformLogger spla = loggerMap.get(loggerName);
SLF4JPlatformLogger spla = loggerMap.get(loggerName);
if (spla != null) {
return spla;
} else {
Logger slf4jLogger = LoggerFactory.getLogger(loggerName);
SLF4JPlarformLogger newInstance = new SLF4JPlarformLogger(slf4jLogger);
SLF4JPlarformLogger oldInstance = loggerMap.putIfAbsent(loggerName, newInstance);
SLF4JPlatformLogger newInstance = new SLF4JPlatformLogger(slf4jLogger);
SLF4JPlatformLogger oldInstance = loggerMap.putIfAbsent(loggerName, newInstance);
return oldInstance == null ? newInstance : oldInstance;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
* Adapts {@link Logger} to {@link System.Logger}.
* @since 2.0.0
*/
class SLF4JPlarformLogger implements System.Logger {
class SLF4JPlatformLogger implements System.Logger {

static private String PRESUMED_CALLER_BOUNDARY = System.Logger.class.getName();

private final Logger slf4jLogger;

public SLF4JPlarformLogger(Logger logger) {
public SLF4JPlatformLogger(Logger logger) {
this.slf4jLogger = requireNonNull(logger);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public System.Logger getLogger(String name, Module module) {
// is updated to forward a module, we should do that here.
//
// [1] https://openjdk.java.net/jeps/264
SLF4JPlarformLogger adapter = platformLoggerFactory.getLogger(name);
SLF4JPlatformLogger adapter = platformLoggerFactory.getLogger(name);
return adapter;
}

Expand Down

0 comments on commit 1d4535a

Please sign in to comment.