本文整理了Java中org.jpos.util.Logger.removeAllListeners()
方法的一些代码示例,展示了Logger.removeAllListeners()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.removeAllListeners()
方法的具体详情如下:
包路径:org.jpos.util.Logger
类名称:Logger
方法名:removeAllListeners
暂无
代码示例来源:origin: jpos/jPOS
protected void stopService() {
if (originalOut != null)
System.setOut(originalOut);
if (originalErr != null)
System.setErr(originalErr);
logger.removeAllListeners ();
}
protected void destroyService() {
代码示例来源:origin: jpos/jPOS
/**
* destroy logger
*/
public void destroy () {
NameRegistrar.unregister (NRPREFIX+name);
removeAllListeners ();
}
/**
代码示例来源:origin: jpos/jPOS
protected void startService () throws ConfigurationException, IOException {
logger.removeAllListeners ();
for (Object o : getPersist().getChildren("log-listener"))
addListener((Element) o);
String redirect = cfg.get("redirect");
long delay = cfg.getLong("delay", 500);
if (redirect.contains("stdout")) {
originalOut = System.out;
System.setOut(new PrintStream(new LogEventOutputStream(logger, "stdout", delay)));
}
if (redirect.contains("stderr")) {
originalErr = System.err;
System.setErr(new PrintStream(new LogEventOutputStream(logger, "stderr", delay)));
}
}
protected void stopService() {
代码示例来源:origin: jpos/jPOS
@Test
public void testRemoveAllListeners3() throws Throwable {
Logger logger = new Logger();
logger.removeAllListeners();
assertEquals("m_logger.listeners.size()", 0, logger.listeners.size());
}
代码示例来源:origin: jpos/jPOS
@Test
public void testRemoveAllListeners() throws Throwable {
Logger logger = Logger.getLogger("testLoggerName");
LogListener l = new SimpleLogListener();
logger.addListener(l);
logger.removeAllListeners();
assertEquals("m_logger.listeners.size()", 0, logger.listeners.size());
assertFalse("m_logger.listeners.contains(l)", logger.listeners.contains(l));
}
代码示例来源:origin: jpos/jPOS
@Test
public void testRemoveAllListeners2() throws Throwable {
Logger logger = new Logger();
LogListener l = new RotateLogListener();
logger.addListener(l);
logger.removeAllListeners();
assertEquals("m_logger.listeners.size()", 0, logger.listeners.size());
assertFalse("m_logger.listeners.contains(l)", logger.listeners.contains(l));
}
代码示例来源:origin: jpos/jPOS
@Test
public void testRemoveAllListeners1() throws Throwable {
Logger logger = new Logger();
logger.addListener(new FilterLogListener());
logger.addListener(new RotateLogListener());
logger.removeAllListeners();
assertEquals("m_logger.listeners.size()", 0, logger.listeners.size());
}
内容来源于网络,如有侵权,请联系作者删除!