Commit af3f7d8d authored by Geoff Simmons's avatar Geoff Simmons

Make default logging less verbose.

At info level, log the latest known VCL mtime. Log all of the mtimes
at debug level.
parent 241fd86f
......@@ -315,11 +315,22 @@ func (updater *SpecUpdater) updatedVCLMap(
return
}
func (updater *SpecUpdater) latestVCLMtime() time.Time {
latest := time.Time{}
for _, t := range updater.vcls {
if t.After(latest) {
latest = t
}
}
return latest
}
// Update generates a new configuration from the current state of the
// k8s cluster, and loads it as a new instance of VCL.
func (updater *SpecUpdater) Update() error {
updater.log.Info("Update signal received")
updater.log.Info("Current VCL file modification times: ", updater.vcls)
updater.log.Debug("Current VCL file modification times: ", updater.vcls)
updater.log.Info("Current latest known VCL file modification time: ",
updater.latestVCLMtime())
spec, err := updater.getSpec()
if err != nil {
// XXX generate Warn event
......@@ -361,7 +372,9 @@ func (updater *SpecUpdater) Update() error {
}
// XXX generate Info event, inc counter(?)
updater.vcls = updatedMap
updater.log.Info("Updated VCL file modification times: ", updater.vcls)
updater.log.Debug("Updated VCL file modification times: ", updater.vcls)
updater.log.Info("Updated latest known VCL file modification time: ",
updater.latestVCLMtime())
updater.log.Info("Varnish update succeeded")
return nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment