From 059ae3a80e665d089195a585d80dc10739f1b2d3 Mon Sep 17 00:00:00 2001
From: zzz <zzz@mail.i2p>
Date: Sun, 3 Nov 2013 15:00:00 +0000
Subject: [PATCH]    - Add network status to event log

---
 .../src/net/i2p/router/transport/CommSystemFacadeImpl.java  | 6 +++++-
 router/java/src/net/i2p/router/util/EventLog.java           | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java
index 2b123312b4..d6401ae482 100644
--- a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java
+++ b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java
@@ -27,6 +27,7 @@ import net.i2p.router.CommSystemFacade;
 import net.i2p.router.OutNetMessage;
 import net.i2p.router.RouterContext;
 import net.i2p.router.transport.udp.UDPTransport;
+import net.i2p.router.util.EventLog;
 import net.i2p.util.Addresses;
 import net.i2p.util.Log;
 import net.i2p.util.SimpleScheduler;
@@ -420,7 +421,10 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
 
         public void timeReached() {
              boolean good = Addresses.isConnected();
-             _netMonitorStatus = good;
+             if (_netMonitorStatus != good) {
+                 _context.router().eventLog().addEvent(EventLog.NETWORK, good ? "connected" : "disconnected");
+                 _netMonitorStatus = good;
+             }
              reschedule(good ? LONG_DELAY : SHORT_DELAY);
         }
     }
diff --git a/router/java/src/net/i2p/router/util/EventLog.java b/router/java/src/net/i2p/router/util/EventLog.java
index 5e58e7c3ab..1c2f3139e4 100644
--- a/router/java/src/net/i2p/router/util/EventLog.java
+++ b/router/java/src/net/i2p/router/util/EventLog.java
@@ -40,6 +40,7 @@ public class EventLog {
     public static final String CRITICAL = "critical";
     public static final String INSTALLED = "installed";
     public static final String INSTALL_FAILED = "intallFailed";
+    public static final String NETWORK = "network";
     public static final String NEW_IDENT = "newIdent";
     public static final String OOM = "oom";
     public static final String REKEYED = "rekeyed";
-- 
GitLab