org.jpos.util.Logger.removeAllListeners()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(209)

本文整理了Java中org.jpos.util.Logger.removeAllListeners()方法的一些代码示例,展示了Logger.removeAllListeners()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.removeAllListeners()方法的具体详情如下:
包路径:org.jpos.util.Logger
类名称:Logger
方法名:removeAllListeners

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());
}

相关文章