org.beifengtz.jvmm.server.logger.DefaultJvmmILoggerFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jvmm-server Show documentation
Show all versions of jvmm-server Show documentation
Provides access to operating system, process, thread and other information during Java runtime.
package org.beifengtz.jvmm.server.logger;
import org.beifengtz.jvmm.common.logger.DefaultImplLogger;
import org.beifengtz.jvmm.common.logger.LoggerLevel;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
/**
* Description: TODO
*
* Created in 17:35 2021/12/15
*
* @author beifengtz
*/
public class DefaultJvmmILoggerFactory implements ILoggerFactory {
static final DefaultImplLogger DEFAULT_IMPL_LOGGER = new DefaultImplLogger();
static volatile DefaultJvmmILoggerFactory INSTANCE = null;
public static DefaultJvmmILoggerFactory newInstance() {
return newInstance(LoggerLevel.INFO);
}
public static DefaultJvmmILoggerFactory newInstance(LoggerLevel level) {
if (INSTANCE == null) {
synchronized (DefaultILoggerFactory.class) {
if (INSTANCE != null) {
return INSTANCE;
}
INSTANCE = new DefaultJvmmILoggerFactory();
DEFAULT_IMPL_LOGGER.setLevel(level);
return INSTANCE;
}
} else {
return INSTANCE;
}
}
@Override
public Logger getLogger(String name) {
return DEFAULT_IMPL_LOGGER;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy