make Slf4JLoggerFactory be singleton (#11253)
Motivation: The current initialization of Slf4JLoggerFactory is not singleton. Modification: Use Slf4JLoggerFactory.INSTANCE to initialize Slf4JLoggerFactory. Result: The instance of Slf4JLoggerFactory became a singleton.
This commit is contained in:
parent
d5c81d9a3e
commit
5178b2c7a5
@ -59,7 +59,7 @@ public abstract class InternalLoggerFactory {
|
||||
|
||||
private static InternalLoggerFactory useSlf4JLoggerFactory(String name) {
|
||||
try {
|
||||
InternalLoggerFactory f = new Slf4JLoggerFactory(true);
|
||||
InternalLoggerFactory f = Slf4JLoggerFactory.INSTANCE_WITH_NOP_CHECK;
|
||||
f.newInstance(name).debug("Using SLF4J as the default logging framework");
|
||||
return f;
|
||||
} catch (LinkageError ignore) {
|
||||
|
@ -30,6 +30,8 @@ public class Slf4JLoggerFactory extends InternalLoggerFactory {
|
||||
@SuppressWarnings("deprecation")
|
||||
public static final InternalLoggerFactory INSTANCE = new Slf4JLoggerFactory();
|
||||
|
||||
static final InternalLoggerFactory INSTANCE_WITH_NOP_CHECK = new Slf4JLoggerFactory(true);
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #INSTANCE} instead.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user