From 5ef3aa697d55d1e8833363314d4e301237611686 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 10 Dec 2019 15:37:16 +0100 Subject: [PATCH] =?utf8?q?=F0=9F=94=8A=20Add=20logging=20for=20injections?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/main/SoneModule.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/net/pterodactylus/sone/main/SoneModule.kt b/src/main/kotlin/net/pterodactylus/sone/main/SoneModule.kt index 97b342a..155d67d 100644 --- a/src/main/kotlin/net/pterodactylus/sone/main/SoneModule.kt +++ b/src/main/kotlin/net/pterodactylus/sone/main/SoneModule.kt @@ -14,8 +14,10 @@ import net.pterodactylus.sone.freenet.* import net.pterodactylus.sone.freenet.wot.* import net.pterodactylus.util.config.* import net.pterodactylus.util.config.ConfigurationException +import net.pterodactylus.util.logging.* import net.pterodactylus.util.version.Version import java.io.* +import java.util.logging.* open class SoneModule(private val sonePlugin: SonePlugin, private val eventBus: EventBus) : AbstractModule() { @@ -58,11 +60,16 @@ open class SoneModule(private val sonePlugin: SonePlugin, private val eventBus: bindListener(Matchers.any(), object : TypeListener { override fun hear(typeLiteral: TypeLiteral, typeEncounter: TypeEncounter) { - typeEncounter.register(InjectionListener { injectee -> eventBus.register(injectee) }) + typeEncounter.register(InjectionListener { injectee -> + logger.fine { "Injecting $injectee..." } + eventBus.register(injectee) + }) } }) } + private val logger: Logger = Logging.getLogger(javaClass) + } private fun String.parseVersion(): Version = Version.parse(this) -- 2.7.4