Log a lot more about subroutings
This commit is contained in:
@@ -62,6 +62,7 @@ class Subrouting(private val parent: Routing, priority: Int, val upstream: Strin
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
Timber.d("Subrouting initialized from %s to %s", parent.downstream, upstream)
|
Timber.d("Subrouting initialized from %s to %s", parent.downstream, upstream)
|
||||||
|
Timber.d(Thread.currentThread().stackTrace.joinToString("\n"))
|
||||||
IpNeighbourMonitor.registerCallback(this)
|
IpNeighbourMonitor.registerCallback(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,6 +72,7 @@ class Subrouting(private val parent: Routing, priority: Int, val upstream: Strin
|
|||||||
override fun close() {
|
override fun close() {
|
||||||
IpNeighbourMonitor.unregisterCallback(this)
|
IpNeighbourMonitor.unregisterCallback(this)
|
||||||
Timber.d("Subrouting closed from %s to %s", parent.downstream, upstream)
|
Timber.d("Subrouting closed from %s to %s", parent.downstream, upstream)
|
||||||
|
Timber.d(Thread.currentThread().stackTrace.joinToString("\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onIpNeighbourAvailable(neighbours: List<IpNeighbour>) = synchronized(parent) {
|
override fun onIpNeighbourAvailable(neighbours: List<IpNeighbour>) = synchronized(parent) {
|
||||||
|
|||||||
@@ -77,8 +77,7 @@ abstract class UpstreamMonitor {
|
|||||||
|
|
||||||
fun registerCallback(callback: Callback) {
|
fun registerCallback(callback: Callback) {
|
||||||
synchronized(this) {
|
synchronized(this) {
|
||||||
if (!callbacks.add(callback)) return
|
if (callbacks.add(callback)) registerCallbackLocked(callback)
|
||||||
registerCallbackLocked(callback)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fun unregisterCallback(callback: Callback) = synchronized(this) {
|
fun unregisterCallback(callback: Callback) = synchronized(this) {
|
||||||
|
|||||||
Reference in New Issue
Block a user