本文整理了Java中org.jpos.util.Logger.log()
方法的一些代码示例,展示了Logger.log()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.log()
方法的具体详情如下:
包路径:org.jpos.util.Logger
类名称:Logger
方法名:log
暂无
代码示例来源:origin: jpos/jPOS
/**
* @param b - new Usable state (used by ISOMUX internals to
* flag as unusable in order to force a reconnection)
*/
public void setUsable(boolean b) {
Logger.log (new LogEvent (this, "usable", b));
usable = b;
}
/**
代码示例来源:origin: jpos/jPOS
protected void getMessageTrailler() throws IOException {
Logger.log (new LogEvent (this, "get-message-trailler"));
byte[] b = new byte[1];
serverIn.readFully(b,0,1);
Logger.log (new LogEvent (this, "got-message-trailler", ISOUtil.hexString(b)));
}
}
代码示例来源:origin: jpos/jPOS
@Override
public void handleUnpackError(ISOComponent isoComponent, byte[] msg, ISOException e) {
StringBuilder sb = new StringBuilder("Error unpacking message:\n");
sb.append(e.toString()).append("\n");
sb.append("Raw data:\n").append(new String(msg)).append("\n");
LogEvent logEvent = new LogEvent(this, "unpack-error");
logEvent.addMessage(sb.toString());
logEvent.addMessage(e);
Logger.log(logEvent);
}
}
代码示例来源:origin: jpos/jPOS
public void info (String detail, Object obj) {
LogEvent evt = new LogEvent (this, "info", detail);
evt.addMessage (obj);
Logger.log (evt);
}
public void warning (String detail) {
代码示例来源:origin: jpos/jPOS
public void warning (String detail, Object obj) {
LogEvent evt = new LogEvent (this, "warning", detail);
evt.addMessage (obj);
Logger.log (evt);
}
public void error (String detail) {
代码示例来源:origin: jpos/jPOS
public void error (Object detail, Object obj) {
LogEvent evt = createError (detail);
evt.addMessage (obj);
Logger.log (evt);
}
public void fatal (Object detail) {
代码示例来源:origin: jpos/jPOS
public void fatal (Object detail, Object obj) {
LogEvent evt = createFatal (detail);
evt.addMessage (obj);
Logger.log (evt);
}
public LogEvent createLogEvent (String level) {
代码示例来源:origin: jpos/jPOS
public void debug (Object detail, Object obj) {
LogEvent evt = createDebug (detail);
evt.addMessage (obj);
Logger.log (evt);
}
public void info (Object detail) {
代码示例来源:origin: jpos/jPOS
public void warn (Object detail, Object obj) {
LogEvent evt = createWarn (detail);
evt.addMessage (obj);
Logger.log (evt);
}
public void error (Object detail) {
代码示例来源:origin: jpos/jPOS
public void trace (Object detail, Object obj) {
LogEvent evt = createTrace (detail);
evt.addMessage (obj);
Logger.log (evt);
}
public void debug (Object detail) {
代码示例来源:origin: jpos/jPOS
public void run() {
for (int i = 0; i < numMessages; i++) {
LogEvent ev = new LogEvent();
ev.addMessage(name + " " + i);
Logger.log(ev);
}
p.checkPoint (name);
done.countDown();
}
}.start();
代码示例来源:origin: jpos/jPOS
@Override
protected int getMessageLength() throws IOException, ISOException {
int len = super.getMessageLength();
LogEvent evt = new LogEvent (this, "fsd-channel-debug");
evt.addMessage ("received message length: " + len);
Logger.log (evt);
return len;
}
}
代码示例来源:origin: jpos/jPOS
@SuppressWarnings("unchecked")
public void run() {
while (running()) {
LogEvent evt = (LogEvent) sp.in (queueName, 1000L);
if (evt != null) {
evt.setSource(getLog());
Logger.log(evt);
}
}
}
代码示例来源:origin: jpos/jPOS
private void logVersion () {
long now = System.currentTimeMillis();
if (now - lastVersionLog > 3600000L) {
LogEvent evt = getLog().createLogEvent("version");
evt.addMessage(getVersionString());
Logger.log(evt);
lastVersionLog = now;
while ((PGPHelper.checkLicense() & 0xE0000) != 0)
relax();
}
}
private void setExit (boolean exit) {
代码示例来源:origin: jpos/jPOS
public void send (byte[] b)
throws IOException,ISOException {
if (!isConnected())
throw new ISOException ("unconnected ISOChannel");
LogEvent evt = new LogEvent (this, "loopback-send", b);
queue.enqueue (b);
cnt[TX]++;
notifyObservers();
Logger.log (evt);
}
代码示例来源:origin: jpos/jPOS
@Test
public void testLogThrowsNullPointerException() throws Throwable {
try {
Logger.log(null);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
代码示例来源:origin: jpos/jPOS
public void send (ISOMsg m)
throws IOException,ISOException {
if (!isConnected())
throw new ISOException ("unconnected ISOChannel");
LogEvent evt = new LogEvent (this, "loopback-send", m);
m = applyOutgoingFilters (m, evt);
queue.enqueue (m);
cnt[TX]++;
notifyObservers();
Logger.log (evt);
}
代码示例来源:origin: jpos/jPOS
@Test
public void testLog2() throws Throwable {
Logger.log(new LogEvent(null, "testLoggerTag", ""));
assertTrue("Test completed without Exception", true);
}
代码示例来源:origin: jpos/jPOS
@Test
public void testLog1() throws Throwable {
Logger.log(new LogEvent(new Log(), "testLoggerTag", "testString"));
assertTrue("Test completed without Exception", true);
}
代码示例来源: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);
}
内容来源于网络,如有侵权,请联系作者删除!