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

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

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

Logger.getLogger介绍

暂无

代码示例

代码示例来源:origin: jpos/jPOS

public static Log getLog (String logName, String realm) {
  return new Log (Logger.getLogger (logName), realm);
}
public Log (Logger logger, String realm) {

代码示例来源:origin: jpos/jPOS

@Override
public void setConfiguration(Configuration cfg) throws ConfigurationException {
  String loggerName = cfg.get("packager-error-logger");
  logger = Logger.getLogger(loggerName);
  realm = cfg.get("realm", "packager-error");
}

代码示例来源:origin: jpos/jPOS-EE

@Override
public void start()
{
  logger = Logger.getLogger(getName());
  super.start();
}

代码示例来源:origin: jpos/jPOS

public Log getLog () {
  if (log == null) {
    Logger logger = Logger.getLogger (LOGGER_NAME);
    if (!hasSystemLogger && !logger.hasListeners() && cli == null)
      logger.addListener (new SimpleLogListener (System.out));
    log = new Log (logger, REALM);
  }
  return log;
}
public MBeanServer getMBeanServer () {

代码示例来源:origin: jpos/jPOS

@Test
public void testGetLogger() throws Throwable {
  Logger result = Logger.getLogger("testLoggerName");
  assertEquals("result.getName()", "testLoggerName", result.getName());
}

代码示例来源: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 testConstructor() throws Throwable {
  Logger logger = Logger.getLogger("testLogName");
  Log log = new Log(logger, "testLogRealm");
  assertEquals("m_log.realm", "testLogRealm", log.realm);
  assertSame("m_log.logger", logger, log.logger);
}

代码示例来源:origin: jpos/jPOS

@Test
public void testGetLogger() throws Throwable {
  Logger logger = Logger.getLogger("testXMLPackagerName");
  xMLPackager.setLogger(logger, "testXMLPackagerRealm");
  Logger result = xMLPackager.getLogger();
  assertSame("result", logger, result);
}

代码示例来源:origin: jpos/jPOS

@Test
public void testGetRealm1() throws Throwable {
  xMLPackager.setLogger(Logger.getLogger("testXMLPackagerName"), "testXMLPackagerRealm");
  String result = xMLPackager.getRealm();
  assertEquals("result", "testXMLPackagerRealm", result);
}

代码示例来源:origin: jpos/jPOS

@Test
public void testSetLogger() throws Throwable {
  Logger logger = Logger.getLogger("testXMLPackagerName");
  xMLPackager.setLogger(logger, "testXMLPackagerRealm");
  assertSame("xMLPackager.logger", logger, xMLPackager.logger);
  assertEquals("xMLPackager.realm", "testXMLPackagerRealm", xMLPackager.realm);
}

代码示例来源:origin: jpos/jPOS

@Test
public void testSetLogger() throws Throwable {
  BaseSMAdapter baseSMAdapter = new BaseSMAdapter();
  Logger logger = Logger.getLogger("testBaseSMAdapterName");
  baseSMAdapter.setLogger(logger, "testBaseSMAdapterRealm");
  assertSame("baseSMAdapter.logger", logger, baseSMAdapter.logger);
  assertEquals("baseSMAdapter.realm", "testBaseSMAdapterRealm", baseSMAdapter.realm);
}

代码示例来源:origin: jpos/jPOS

@Test
public void testSetLogger() throws Throwable {
  Logger logger = Logger.getLogger("testSimpleKeyFileName");
  SimpleKeyFile simpleKeyFile = new SimpleKeyFile();
  simpleKeyFile.setLogger(logger, "testSimpleKeyFileRealm");
  assertSame("simpleKeyFile.logger", logger, simpleKeyFile.logger);
  assertEquals("simpleKeyFile.realm", "testSimpleKeyFileRealm", simpleKeyFile.realm);
}

代码示例来源:origin: jpos/jPOS

@Test
public void testGetLogger() throws Throwable {
  Logger logger = Logger.getLogger("testSimpleKeyFileName");
  SimpleKeyFile simpleKeyFile = new SimpleKeyFile();
  simpleKeyFile.setLogger(logger, "testSimpleKeyFileRealm");
  Logger result = simpleKeyFile.getLogger();
  assertSame("result", logger, result);
}

代码示例来源:origin: jpos/jPOS

@Test
public void testGetRealm1() throws Throwable {
  SimpleKeyFile simpleKeyFile = new SimpleKeyFile();
  simpleKeyFile.setLogger(Logger.getLogger("testSimpleKeyFileName"), "testSimpleKeyFileRealm");
  String result = simpleKeyFile.getRealm();
  assertEquals("result", "testSimpleKeyFileRealm", result);
}

代码示例来源:origin: jpos/jPOS

@Test
public void testGetLogger() throws Throwable {
  BaseSMAdapter baseSMAdapter = new BaseSMAdapter();
  Logger logger = Logger.getLogger("testBaseSMAdapterName");
  baseSMAdapter.setLogger(logger, "testBaseSMAdapterRealm");
  Logger result = baseSMAdapter.getLogger();
  assertSame("result", logger, result);
}

代码示例来源:origin: jpos/jPOS

@Test(expected = NullPointerException.class)
  public void testValidateThrowsNullPointerException3() throws Throwable {
    CTCSubFieldPackager cTCSubFieldPackager = new CTCSubFieldPackager();
    cTCSubFieldPackager.setLogger(Logger.getLogger(""), "testCTCSubFieldPackagerRealm");
    ISOValidator[] fvlds = new ISOValidator[2];
    cTCSubFieldPackager.setFieldValidator(fvlds);
    cTCSubFieldPackager.validate(new ISOMsg("testCTCSubFieldPackagerMti"));
  }
}

代码示例来源:origin: jpos/jPOS

@Test
public void testConstructorThrowsConfigurationException() throws Throwable {
  try {
    new JCESecurityModule(new SimpleConfiguration(), Logger.getLogger("."), "testJCESecurityModuleRealm");
    fail("Expected ConfigurationException to be thrown");
  } catch (ConfigurationException ex) {
    assertTrue("Test completed without Exception", true);
    // dependencies on static and environment state led to removal of 4
    // assertions
  }
}

代码示例来源:origin: jpos/jPOS

@Test
public void testLog() throws Throwable {
  Logger.log(new LogEvent(new SimpleLogSource(Logger.getLogger("testLoggerName"), "testLoggerRealm"), "testLoggerTag",
      "testString"));
  assertTrue("Test completed without Exception", true);
}

代码示例来源:origin: jpos/jPOS

@Test
  public void testSetLogger() throws Throwable {
    EuroPackager euroPackager = new EuroPackager();
    Logger logger = Logger.getLogger("testEuroPackagerName");
    euroPackager.setLogger(logger, "testEuroPackagerRealm");
    assertSame("euroPackager.getLogger()", logger, euroPackager.getLogger());
    assertNotNull("euroPackager.f48Packager", euroPackager.f48Packager);
    assertEquals("euroPackager.getRealm()", "testEuroPackagerRealm", euroPackager.getRealm());
  }
}

代码示例来源:origin: jpos/jPOS

@Test
  public void testSetLogger() throws Throwable {
    PostPackager postPackager = new PostPackager();
    Logger logger = Logger.getLogger("testPostPackagerName");
    postPackager.setLogger(logger, "testPostPackagerRealm");
    assertNotNull("postPackager.p127", postPackager.p127);
    assertSame("postPackager.getLogger()", logger, postPackager.getLogger());
    assertEquals("postPackager.getRealm()", "testPostPackagerRealm", postPackager.getRealm());
  }
}

相关文章