config: update coordinator's logs

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
Simon Pasquier 2019-02-26 16:41:50 +01:00
parent 891f368c51
commit 873f1fb87c
1 changed files with 10 additions and 12 deletions

View File

@ -95,19 +95,9 @@ func (c *Coordinator) notifySubscribers() error {
// loadFromFile triggers a configuration load, discarding the old configuration.
func (c *Coordinator) loadFromFile() error {
level.Info(c.logger).Log(
"msg", "Loading configuration file",
"file", c.configFilePath,
)
conf, plainConfig, err := LoadFile(c.configFilePath)
if err != nil {
c.configSuccessMetric.Set(0)
level.Error(c.logger).Log(
"msg", "Loading configuration file failed",
"file", c.configFilePath,
"err", err,
)
return err
}
@ -126,14 +116,22 @@ func (c *Coordinator) Reload() error {
c.mutex.Lock()
defer c.mutex.Unlock()
level.Info(c.logger).Log(
"msg", "Loading configuration file",
"file", c.configFilePath,
)
if err := c.loadFromFile(); err != nil {
c.logger.Log(
"msg", "loading configuration file failed",
level.Error(c.logger).Log(
"msg", "Loading configuration file failed",
"file", c.configFilePath,
"err", err,
)
return err
}
level.Info(c.logger).Log(
"msg", "Completed loading of configuration file",
"file", c.configFilePath,
)
if err := c.notifySubscribers(); err != nil {
c.logger.Log(