@Override public void killInstance() { if (isKilled) { bf.log.error("Already killed!! " + this, new Exception()); return; } if (bf.log.shouldLog(Log.DEBUG)) bf.log.debug("Killing " + this + ' ' + print() /* , new Exception() */ ); isKilled = true; bsl.levelHash.remove(Integer.valueOf(levelPage)); bf.freePage(levelPage); }
public void gotDateTime(long time) { if (_log.shouldDebug()) _log.debug("Got updated datetime block"); receiveTimestamp((time + 500) / 1000); // update skew }
public void timeReached() { // only do this once _read = Integer.MIN_VALUE; if (_log.shouldWarn()) _log.warn("timeout after AEAD failure waiting for more data on " + NTCPConnection.this); sendTermination(REASON_AEAD, _validFramesRcvd); }
public void gotOptions(byte[] options, boolean isHandshake) { NTCP2Options hisPadding = NTCP2Options.fromByteArray(options); if (hisPadding == null) { if (_log.shouldWarn()) _log.warn("Got options length " + options.length + " on: " + this); return; } _paddingConfig = OUR_PADDING.merge(hisPadding); if (_log.shouldDebug()) _log.debug("Got padding options:" + "\nhis padding options: " + hisPadding + "\nour padding options: " + OUR_PADDING + "\nmerged config is: " + _paddingConfig); }
/** * BEP 6 * Ignored for now * @since 0.9.21 */ void allowedFastMessage(int piece) { if (_log.shouldInfo()) _log.info("Ignoring allowed_fast(" + piece + ") from " + peer); }
@Override public void pingReceived(String data) { if (_log.shouldInfo()) _log.info("Got PING " + data + ", sending PONG " + data); synchronized (_out) { try { _out.write(("PONG " + data + '\n').getBytes("UTF-8")); _out.flush(); } catch (IOException ioe) { _log.error("PONG fail", ioe); } } }
@Override public void run() { try { startUp(); } catch(Exception e) { log.error("Failed while running desktopgui!", e); changeState(START_FAILED, "Failed while running desktopgui!", e); } }
public void setNow(long realTime) { if (realTime < BuildTime.getEarliestTime() || realTime > BuildTime.getLatestTime()) { Log log = getLog(); String msg = "Invalid time received: " + new Date(realTime); if (log.shouldWarn()) log.warn(msg, new Exception()); else log.logAlways(Log.WARN, msg); return; } long diff = realTime - System.currentTimeMillis(); setOffset(diff); }
/** Instruct the client that the session specified seems to be under attack * and that the client may wish to move its destination to another router. * @param session session to report abuse to * @param severity how bad the abuse is */ public void reportAbuse(I2PSession session, int severity) { if (_log.shouldLog(Log.ERROR)) _log.error("Abuse reported with severity " + severity); _manager.disconnectAllHard(); }
private void log(String msg, Throwable t) { int level = (t != null) ? Log.WARN : Log.INFO; _log.log(level, msg, t); }
public AESEngine(I2PAppContext ctx) { _context = ctx; _log = _context.logManager().getLog(getClass()); if (getClass().equals(AESEngine.class)) _log.logAlways(Log.WARN, "AES is disabled"); }
public GnuClasspathDeallocator() { super(); try { final Class<?> vmDirectByteBufferClass = Class.forName("java.nio.VMDirectByteBuffer"); final Class<?> gnuClasspathPointerClass = Class.forName("gnu.classpath.Pointer"); vmDirectByteBufferFreeMethod = vmDirectByteBufferClass.getDeclaredMethod("free", gnuClasspathPointerClass); bufferAddressField = Buffer.class.getDeclaredField("address"); } catch (ClassNotFoundException | NoSuchMethodException | NoSuchFieldException e) { logger.warn("The initialization of the deallocator for GNU Classpath has failed", e); } }
private void messageReceived(byte[] msg, int proto, int fromPort, int toPort) { if (_log.shouldWarn()) _log.warn("Unhandled message received, length = " + msg.length + " protocol: " + proto + " from port: " + fromPort + " to port: " + toPort); }