From 18b8ddc419de64699d58286c97818e99463b2ef4 Mon Sep 17 00:00:00 2001 From: zzz Date: Sat, 17 Dec 2011 14:04:57 +0000 Subject: [PATCH] misc. log tweaks --- core/java/src/net/i2p/util/SimpleTimer2.java | 2 +- history.txt | 8 ++++++++ router/java/src/net/i2p/router/InNetMessagePool.java | 7 ++++--- router/java/src/net/i2p/router/RouterVersion.java | 4 ++-- .../i2p/router/message/GarlicMessageReceiver.java | 2 +- .../java/src/net/i2p/router/tunnel/HopProcessor.java | 12 ++++++++++-- .../i2p/router/tunnel/InboundEndpointProcessor.java | 2 +- .../src/net/i2p/router/tunnel/pool/TunnelPool.java | 4 ++-- 8 files changed, 29 insertions(+), 12 deletions(-) diff --git a/core/java/src/net/i2p/util/SimpleTimer2.java b/core/java/src/net/i2p/util/SimpleTimer2.java index 84793c085a..ab568d6446 100644 --- a/core/java/src/net/i2p/util/SimpleTimer2.java +++ b/core/java/src/net/i2p/util/SimpleTimer2.java @@ -235,7 +235,7 @@ public class SimpleTimer2 { if (_log.shouldLog(Log.WARN) && delay > 100) _log.warn(_pool + " wtf, early execution " + delay + ": " + this); else if (_log.shouldLog(Log.WARN) && delay < -1000) - _log.warn(" wtf, late execution " + delay + ": " + this + _pool.debug()); + _log.warn(" wtf, late execution " + (0 - delay) + ": " + this + _pool.debug()); try { timeReached(); } catch (Throwable t) { diff --git a/history.txt b/history.txt index a829ae6b43..d0d54bac94 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,11 @@ +2011-12-17 zzz + * i2psnark: + - Replace file name characters not supported in default charset + - Add torrent file name to local details page + * GeoIP: Reduce thread priority during lookup + * ProfileManager: Make some methods non-blocking to reduce + lock contention in transports + 2011-12-15 kytv * Swedish translation updates from Transifex diff --git a/router/java/src/net/i2p/router/InNetMessagePool.java b/router/java/src/net/i2p/router/InNetMessagePool.java index a6fdbae3a3..579ae8f398 100644 --- a/router/java/src/net/i2p/router/InNetMessagePool.java +++ b/router/java/src/net/i2p/router/InNetMessagePool.java @@ -146,14 +146,15 @@ public class InNetMessagePool implements Service { //if (messageBody instanceof TunnelCreateMessage) // level = Log.INFO; if (_log.shouldLog(level)) - _log.log(level, "Duplicate message received [" + messageBody.getUniqueId() - + " expiring on " + exp + "]: " + messageBody.getClass().getName() + ": " + invalidReason + _log.log(level, "Dropping message [" + messageBody.getUniqueId() + + " expiring on " + exp + "]: " + messageBody.getClass().getSimpleName() + ": " + invalidReason + ": " + messageBody); _context.statManager().addRateData("inNetPool.dropped", 1, 0); + // FIXME not necessarily a duplicate, could be expired too long ago / too far in future _context.statManager().addRateData("inNetPool.duplicate", 1, 0); _context.messageHistory().droppedOtherMessage(messageBody, (fromRouter != null ? fromRouter.calculateHash() : fromRouterHash)); _context.messageHistory().messageProcessingError(messageBody.getUniqueId(), - messageBody.getClass().getName(), + messageBody.getClass().getSimpleName(), "Duplicate/expired"); return -1; } else { diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 43dca92409..a85b0c8aa2 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,10 +18,10 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 21; + public final static long BUILD = 22; /** for example "-test" */ - public final static String EXTRA = ""; + public final static String EXTRA = "-rc"; public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA; public static void main(String args[]) { System.out.println("I2P Router version: " + FULL_VERSION); diff --git a/router/java/src/net/i2p/router/message/GarlicMessageReceiver.java b/router/java/src/net/i2p/router/message/GarlicMessageReceiver.java index def373cf7a..2ebe042b94 100644 --- a/router/java/src/net/i2p/router/message/GarlicMessageReceiver.java +++ b/router/java/src/net/i2p/router/message/GarlicMessageReceiver.java @@ -112,7 +112,7 @@ public class GarlicMessageReceiver { _log.warn("Clove is NOT valid: id=" + clove.getCloveId() + " expiration " + howLongAgo + " ago: " + invalidReason + ": " + clove); _context.messageHistory().messageProcessingError(clove.getCloveId(), - clove.getData().getClass().getName(), + clove.getData().getClass().getSimpleName(), "Clove is not valid (expiration " + howLongAgo + " ago)"); } return (invalidReason == null); diff --git a/router/java/src/net/i2p/router/tunnel/HopProcessor.java b/router/java/src/net/i2p/router/tunnel/HopProcessor.java index 21b9dc5db9..899894bc72 100644 --- a/router/java/src/net/i2p/router/tunnel/HopProcessor.java +++ b/router/java/src/net/i2p/router/tunnel/HopProcessor.java @@ -12,7 +12,7 @@ import net.i2p.util.Log; * want. The hop processor works the same on all peers - * inbound and outbound participants, outbound endpoints, * and inbound gateways (with a small modification per - * InbuondGatewayProcessor). + * InboundGatewayProcessor). * */ class HopProcessor { @@ -77,7 +77,7 @@ class HopProcessor { boolean okIV = _validator.receiveIV(orig, offset, orig, offset + IV_LENGTH); if (!okIV) { if (_log.shouldLog(Log.WARN)) - _log.warn("Invalid IV received on tunnel " + _config.getReceiveTunnel()); + _log.warn("Invalid IV, dropping at hop " + _config); return false; } @@ -111,4 +111,12 @@ class HopProcessor { private final void updateIV(byte orig[], int offset) { _context.aes().encryptBlock(orig, offset, _config.getIVKey(), orig, offset); } + + /** + * @since 0.8.12 + */ + @Override + public String toString() { + return getClass().getSimpleName() + " for " + _config; + } } diff --git a/router/java/src/net/i2p/router/tunnel/InboundEndpointProcessor.java b/router/java/src/net/i2p/router/tunnel/InboundEndpointProcessor.java index 28800c4ac8..bd362055b6 100644 --- a/router/java/src/net/i2p/router/tunnel/InboundEndpointProcessor.java +++ b/router/java/src/net/i2p/router/tunnel/InboundEndpointProcessor.java @@ -63,7 +63,7 @@ class InboundEndpointProcessor { boolean ok = _validator.receiveIV(iv, 0, orig, offset + HopProcessor.IV_LENGTH); if (!ok) { if (_log.shouldLog(Log.WARN)) - _log.warn("Invalid IV received"); + _log.warn("Invalid IV, dropping at IBEP " + _config); _cache.release(ba); return false; } diff --git a/router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java b/router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java index a911f2894a..c5397580f1 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java +++ b/router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java @@ -80,8 +80,8 @@ public class TunnelPool { synchronized (_inProgress) { _inProgress.clear(); } - if (_log.shouldLog(Log.WARN)) - _log.warn(toString() + ": Startup() called, was already alive? " + _alive, new Exception()); + if (_log.shouldLog(Log.INFO)) + _log.info(toString() + ": Startup() called, was already alive? " + _alive, new Exception()); _alive = true; _started = System.currentTimeMillis(); _lastRateUpdate = _started;