Log amount of loaded rules on reload

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-05-11 00:24:36 +02:00
parent 6a03840592
commit d1e63f0c2b
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D
2 changed files with 8 additions and 4 deletions

View file

@ -24,8 +24,8 @@ type configFile struct {
rawLogWriter io.WriteCloser rawLogWriter io.WriteCloser
} }
func newConfigFile() configFile { func newConfigFile() *configFile {
return configFile{ return &configFile{
PermitTimeout: time.Minute, PermitTimeout: time.Minute,
} }
} }
@ -84,7 +84,7 @@ func loadConfig(filename string) error {
} }
} }
config = &tmpConfig config = tmpConfig
return nil return nil
} }

View file

@ -127,7 +127,11 @@ func main() {
irc.ExecuteJoins(config.Channels) irc.ExecuteJoins(config.Channels)
log.Info("Config file reloaded") log.WithFields(log.Fields{
"auto_messages": len(config.AutoMessages),
"rules": len(config.Rules),
"channels": len(config.Channels),
}).Info("Config file reloaded")
case <-autoMessageTicker.C: case <-autoMessageTicker.C:
configLock.RLock() configLock.RLock()