private void log(String msg, Throwable t) { int level = (t != null) ? Log.WARN : Log.INFO; _log.log(level, msg, t); }
public void warn(String msg) { log(WARN, msg); }
public void info(String msg) { log(INFO, msg); }
public void error(String msg, Throwable t) { log(ERROR, msg, t); }
public void debug(String msg) { log(DEBUG, msg); }
public void info(String msg, Throwable t) { log(INFO, msg, t); }
public void error(String msg) { log(ERROR, msg); }
public void debug(String msg, Throwable t) { log(DEBUG, msg, t); }
public void run() { while (_alive) { try { doPass(); } catch (RuntimeException re) { _log.log(Log.CRIT, "Error in the establisher", re); } } _inboundStates.clear(); _outboundStates.clear(); _queuedOutbound.clear(); _outboundByClaimedAddress.clear(); _outboundByHash.clear(); }
public void run() { try { _transport.afterSend(_msg, true, false, _msg.getSendTime()); // appx 0.1 ms //_context.statManager().addRateData("ntcp.sendFinishTime", _context.clock().now() - _queued, 0); } catch (Throwable t) { _log.log(Log.CRIT, " afterSend broken?", t); } } }
private static void log(I2PAppContext ctx, int level, String msg, Throwable t) { if (level >= Log.WARN && !ctx.isRouterContext()) { System.out.println(msg); if (t != null) t.printStackTrace(); } Log l = ctx.logManager().getLog(KeyStoreUtil.class); l.log(level, msg, t); }
public synchronized void startPumping() { if (_log.shouldLog(Log.INFO)) _log.info("Starting pumper"); try { _selector = Selector.open(); _alive = true; new I2PThread(this, "NTCP Pumper", true).start(); } catch (IOException ioe) { _log.log(Log.CRIT, "Error opening the NTCP selector", ioe); } catch (java.lang.InternalError jlie) { // "unable to get address of epoll functions, pre-2.6 kernel?" _log.log(Log.CRIT, "Error opening the NTCP selector", jlie); } }
private static void log(I2PAppContext ctx, int level, String msg, Throwable t) { Log l = ctx.logManager().getLog(CertUtil.class); l.log(level, msg, t); }
public void runJob() { String keyDir = getContext().getProperty(PROP_KEYDIR, DEFAULT_KEYDIR); File dir = new SecureDirectory(getContext().getRouterDir(), keyDir); if (!dir.exists()) dir.mkdirs(); if (dir.exists() && dir.isDirectory() && dir.canRead() && dir.canWrite()) { synchronized(KeyManager.this) { syncKeys(dir); } } else { _log.log(Log.CRIT, "Unable to synchronize keys in " + keyDir + " - permissions problem?"); } }
@Override public byte[] toByteArray() { byte data[] = new byte[getMessageSize()]; int written = toByteArray(data); if (written != data.length) { _log.log(Log.CRIT, "Error writing out " + data.length + " (written: " + written + ", msgSize: " + getMessageSize() + ", writtenLen: " + calculateWrittenLength() + ") for " + getClass().getSimpleName()); return null; } return data; }
public void run() { try { run2(); } catch (RuntimeException e) { _log.log(Log.CRIT, "Uncaught I2CP error", e); _listener.readError(I2CPMessageReader.this, e); cancelRunner(); } }
@Override protected void afterExecute(Runnable r, Throwable t) { super.afterExecute(r, t); if (t != null) { // shoudn't happen, caught in RunnableEvent.run() Log log = I2PAppContext.getGlobalContext().logManager().getLog(SimpleTimer2.class); log.log(Log.CRIT, "event borked: " + r, t); } } }
public static void dumpStats(I2PAppContext context, int logLevel) { if (!_log.shouldLog(logLevel)) return; StringBuilder buf = new StringBuilder(4 * 1024); dumpFrequencies(context, buf); dumpRates(context, buf); _log.log(logLevel, buf.toString()); }
public void timeReached() { try { _context.netDb().publish(_context.router().getRouterInfo()); } catch (IllegalArgumentException iae) { Log log = _context.logManager().getLog(Router.class); log.log(Log.CRIT, "Local router info is invalid? rebuilding a new identity", iae); _context.router().rebuildNewIdentity(); } } }
@Override public void run() { setName("Router " + _id + " shutdown"); Log l = _context.logManager().getLog(Router.class); l.log(Log.CRIT, "Shutting down the router..."); // Needed to make the wrapper happy, otherwise it gets confused // and thinks we haven't shut down, possibly because it // prevents other shutdown hooks from running _context.router().eventLog().addEvent(EventLog.CRASHED, RouterVersion.FULL_VERSION); _context.router().setKillVMOnEnd(false); _context.router().shutdown2(Router.EXIT_HARD); } }