Added disabled modules/commands logging
This commit is contained in:
parent
3d49ebbd5f
commit
0880d53894
1 changed files with 11 additions and 0 deletions
|
@ -37,12 +37,15 @@ import net.thauvin.erik.mobibot.commands.links.LinksMgr
|
|||
import net.thauvin.erik.mobibot.modules.AbstractModule
|
||||
import org.pircbotx.hooks.events.PrivateMessageEvent
|
||||
import org.pircbotx.hooks.types.GenericMessageEvent
|
||||
import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
import java.util.Properties
|
||||
|
||||
/**
|
||||
* Modules and Commands addons.
|
||||
*/
|
||||
class Addons(private val props: Properties) {
|
||||
private val logger: Logger = LoggerFactory.getLogger(Addons::class.java)
|
||||
private val disabledModules = props.getProperty("disabled-modules", "").split(LinksMgr.TAG_MATCH.toRegex())
|
||||
private val disableCommands = props.getProperty("disabled-commands", "").split(LinksMgr.TAG_MATCH.toRegex())
|
||||
|
||||
|
@ -66,6 +69,10 @@ class Addons(private val props: Properties) {
|
|||
modules.add(this)
|
||||
names.modules.add(name)
|
||||
names.commands.addAll(commands)
|
||||
} else {
|
||||
if (logger.isDebugEnabled) {
|
||||
logger.debug("Module $name is disabled.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -91,6 +98,10 @@ class Addons(private val props: Properties) {
|
|||
names.commands.add(name)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (logger.isDebugEnabled) {
|
||||
logger.debug("Command $name is disabled.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue