Skip to content

Commit

Permalink
protect sensitive config value (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
tianxiaoliang authored May 14, 2019
1 parent 4365606 commit 77d6ddb
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions archaius.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,6 @@ func CustomInit(sources ...core.ConfigSource) error {
return err
}
}

eventHandler := EventListener{
Name: "EventHandler",
Factory: factory,
}

factory.RegisterListener(eventHandler, "a*")

return err
}

Expand All @@ -150,7 +142,7 @@ func EnableConfigCenterSource(ci ConfigCenterInfo, cc config.Client) error {
return errors.New("ConfigCenterInfo can not be empty")
}
if configServerRunning {
openlogging.Debug("can not init config server again, call Clean first")
openlogging.Warn("can not init config server again, call Clean first")
return nil
}

Expand Down Expand Up @@ -178,13 +170,6 @@ func EnableConfigCenterSource(ci ConfigCenterInfo, cc config.Client) error {
if err != nil {
return err
}

eventHandler := EventListener{
Name: "EventHandler",
Factory: factory,
}

factory.RegisterListener(eventHandler, "a*")
configServerRunning = true
return nil
}
Expand All @@ -198,7 +183,7 @@ type EventListener struct {
// Event is invoked while generating events at run time
func (e EventListener) Event(event *core.Event) {
value := e.Factory.GetConfigurationByKey(event.Key)
openlogging.GetLogger().Infof("config value after change %s | %s", event.Key, value)
openlogging.GetLogger().Debugf("config value after change %s | %s", event.Key, value)
}

// Get is for to get the value of configuration key
Expand Down

0 comments on commit 77d6ddb

Please sign in to comment.