本文整理汇总了Java中org.geotools.util.logging.Logging类的典型用法代码示例。如果您正苦于以下问题:Java Logging类的具体用法?Java Logging怎么用?Java Logging使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Logging类属于org.geotools.util.logging包,在下文中一共展示了Logging类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testLogging
import org.geotools.util.logging.Logging; //导入依赖的package包/类
@Test
public void testLogging() {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext();
context.setId("test");
context.setDisplayName("test");
context.setConfigLocation("/org/geomajas/spring/geomajasContext.xml ");
context.refresh();
Assert.assertSame(Logging.GEOTOOLS.getLoggerFactory(), Slf4jLoggerFactory.getInstance());
}
示例2: testSlf4j
import org.geotools.util.logging.Logging; //导入依赖的package包/类
@Test
public void testSlf4j() throws ClassNotFoundException {
try {
Logging.GEOTOOLS.setLoggerFactory("org.geomajas.internal.configuration.Slf4jLoggerFactory");
Logger log = Logging.getLogger("org.geotools.SLF4JLoggerTestTrace");
assertTrue(log instanceof Slf4jLogger);
assertEquals(Level.FINEST, log.getLevel());
log = Logging.getLogger("org.geotools.SLF4JLoggerTestDebug");
assertTrue(log instanceof Slf4jLogger);
assertEquals(Level.FINE, log.getLevel());
log = Logging.getLogger("org.geotools.SLF4JLoggerTestInfo");
assertTrue(log instanceof Slf4jLogger);
assertEquals(Level.INFO, log.getLevel());
log = Logging.getLogger("org.geotools.SLF4JLoggerTestWarn");
assertTrue(log instanceof Slf4jLogger);
assertEquals(Level.WARNING, log.getLevel());
log = Logging.getLogger("org.geotools.SLF4JLoggerTestError");
assertTrue(log instanceof Slf4jLogger);
assertEquals(Level.SEVERE, log.getLevel());
log = Logging.getLogger("org.geotools.SLF4JLoggerTestOff");
assertTrue(log instanceof Slf4jLogger);
assertEquals(Level.OFF, log.getLevel());
} finally {
Logging.GEOTOOLS.setLoggerFactory((String) null);
assertEquals(Logger.class, Logging.getLogger("org.geotools").getClass());
}
}
示例3: postConstruct
import org.geotools.util.logging.Logging; //导入依赖的package包/类
@PostConstruct
public void postConstruct() {
Logging.GEOTOOLS.setLoggerFactory(Slf4jLoggerFactory.getInstance());
}