From c626bb64bd9bac4c4e74123436ad0214dcba09ef Mon Sep 17 00:00:00 2001 From: zzz Date: Thu, 8 Mar 2018 14:11:40 +0000 Subject: [PATCH] log flush tweak --- router/java/src/net/i2p/router/Router.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java index 4ccb12da4..feb0e806e 100644 --- a/router/java/src/net/i2p/router/Router.java +++ b/router/java/src/net/i2p/router/Router.java @@ -768,8 +768,11 @@ public class Router implements RouterClock.ClockShiftListener { oldState = _state; _state = state; } - if (_log != null && state != State.STOPPED && _log.shouldLog(Log.WARN)) + if (_log != null && oldState != state && state != State.STOPPED && _log.shouldLog(Log.WARN)) { _log.warn("Router state change from " + oldState + " to " + state /* , new Exception() */ ); + //for debugging + _context.logManager().flush(); + } } /** @@ -808,9 +811,6 @@ public class Router implements RouterClock.ClockShiftListener { else if (_state == State.EXPL_TUNNELS_READY) changeState(State.RUNNING); } - // for debugging - if (_log.shouldWarn()) - _context.logManager().flush(); } /** @@ -825,9 +825,6 @@ public class Router implements RouterClock.ClockShiftListener { else if (_state == State.NETDB_READY) changeState(State.RUNNING); } - // for debugging - if (_log.shouldWarn()) - _context.logManager().flush(); } /**