public synchronized Log getLog() { if (log == null) { log = Log.getLog("Q2", "DB"); // Q2 standard Logger } return log; }
public JPOSLogger(String name) { this.log = Log.getLog("Q2", "slf4j::" + name); }
public void run () { if (message != null) Log.getLog (logName, realm).warn (message); } }
@Override public void setLogger (String loggerName) { log = Log.getLog (loggerName, getClass().getName()); setModified (true); }
protected void handleExit() { if (serverSession != null) { try { serverSession.disconnect(SshConstants.SSH2_DISCONNECT_BY_APPLICATION, ""); } catch (IOException e) { Log.getLog(Q2.LOGGER_NAME, "sshd").error(e); } } }
public boolean authenticate(String username, PublicKey key, ServerSession session) { boolean res = false; List<PublicKey> authorizedKeys=null; try { authorizedKeys = parseAuthorizedKeys(); } catch (Exception e) { Log.getLog(Q2.LOGGER_NAME, "sshd").error(e); } if(authorizedKeys!=null) { for (PublicKey authorizedKey : authorizedKeys) { res = compare(authorizedKey, key); if (res) { break; } } } return res && username!=null && username.equals(getUsername()); }
); LogEvent evt = Log.getLog(Q2.LOGGER_NAME, this.getClass().getName()).createLogEvent("config"); for (PanRegExp r : regexps) evt.addMessage("00:" + r);
@Test public void testGetLog() throws Throwable { Log result = Log.getLog("testLogLogName", "testLogRealm"); assertEquals("result.getRealm()", "testLogRealm", result.getRealm()); }
@Test public void testGetRealm() throws Throwable { String result = Log.getLog("testLogLogName", "testLogRealm").getRealm(); assertEquals("result", "testLogRealm", result); }
@Test public void testCreateInfo() throws Throwable { LogEvent result = Log.getLog("testLogLogName", "testLogRealm").createInfo("testString"); assertEquals("result.getRealm()", "testLogRealm", result.getRealm()); }
@Test public void testCreateTrace() throws Throwable { LogEvent result = Log.getLog("testLogLogName", "testLogRealm").createTrace(); assertEquals("result.getRealm()", "testLogRealm", result.getRealm()); }