forked from I2P_Developers/i2p.i2p
- Add network status to event log
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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";
|
||||
|
Reference in New Issue
Block a user