From: David ‘Bombe’ Roden Date: Tue, 10 Dec 2019 14:37:16 +0000 (+0100) Subject: 🔊 Add logging for injections X-Git-Tag: v81^2~5^2~73 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=5ef3aa697d55d1e8833363314d4e301237611686;p=Sone.git 🔊 Add logging for injections --- 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)