I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 059ae3a8 authored by zzz's avatar zzz
Browse files

- Add network status to event log

parent 67e242c4
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ import net.i2p.router.CommSystemFacade; ...@@ -27,6 +27,7 @@ import net.i2p.router.CommSystemFacade;
import net.i2p.router.OutNetMessage; import net.i2p.router.OutNetMessage;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
import net.i2p.router.transport.udp.UDPTransport; import net.i2p.router.transport.udp.UDPTransport;
import net.i2p.router.util.EventLog;
import net.i2p.util.Addresses; import net.i2p.util.Addresses;
import net.i2p.util.Log; import net.i2p.util.Log;
import net.i2p.util.SimpleScheduler; import net.i2p.util.SimpleScheduler;
...@@ -420,7 +421,10 @@ public class CommSystemFacadeImpl extends CommSystemFacade { ...@@ -420,7 +421,10 @@ public class CommSystemFacadeImpl extends CommSystemFacade {
public void timeReached() { public void timeReached() {
boolean good = Addresses.isConnected(); 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); reschedule(good ? LONG_DELAY : SHORT_DELAY);
} }
} }
......
...@@ -40,6 +40,7 @@ public class EventLog { ...@@ -40,6 +40,7 @@ public class EventLog {
public static final String CRITICAL = "critical"; public static final String CRITICAL = "critical";
public static final String INSTALLED = "installed"; public static final String INSTALLED = "installed";
public static final String INSTALL_FAILED = "intallFailed"; public static final String INSTALL_FAILED = "intallFailed";
public static final String NETWORK = "network";
public static final String NEW_IDENT = "newIdent"; public static final String NEW_IDENT = "newIdent";
public static final String OOM = "oom"; public static final String OOM = "oom";
public static final String REKEYED = "rekeyed"; public static final String REKEYED = "rekeyed";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment