log tweaks

This commit is contained in:
zzz
2018-03-07 16:19:38 +00:00
parent 665f58d62a
commit ceac733b66
3 changed files with 10 additions and 4 deletions

View File

@@ -330,8 +330,8 @@ public class SnarkManager implements CompleteListener, ClientApp {
* Runs inline.
*/
public void stop() {
if (_log.shouldWarn())
_log.warn("Snark stop() begin", new Exception("I did it"));
if (_log.shouldDebug())
_log.debug("Snark stop() begin", new Exception("I did it"));
if (_umgr != null && _uhandler != null) {
//_uhandler.shutdown();
_umgr.unregister(_uhandler, UpdateType.ROUTER_SIGNED, UpdateMethod.TORRENT);

View File

@@ -808,6 +808,9 @@ public class Router implements RouterClock.ClockShiftListener {
else if (_state == State.EXPL_TUNNELS_READY)
changeState(State.RUNNING);
}
// for debugging
if (_log.shouldWarn())
_context.logManager().flush();
}
/**
@@ -822,6 +825,9 @@ public class Router implements RouterClock.ClockShiftListener {
else if (_state == State.NETDB_READY)
changeState(State.RUNNING);
}
// for debugging
if (_log.shouldWarn())
_context.logManager().flush();
}
/**

View File

@@ -44,8 +44,8 @@ public class ReadConfigJob extends JobImpl {
getContext().router().readConfig();
_lastRead = getContext().clock().now();
Log log = getContext().logManager().getLog(ReadConfigJob.class);
if (log.shouldLog(Log.WARN))
log.warn("Reloaded " + configFile);
if (log.shouldDebug())
log.debug("Reloaded " + configFile);
}
requeue(DELAY);
}