mirror of
https://github.com/prometheus/prometheus
synced 2025-01-09 08:00:53 +00:00
discovery/file: fix logging (#4178)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
a3ddde0800
commit
0e5e7f75cd
@ -279,7 +279,7 @@ func (d *Discovery) deleteTimestamp(filename string) {
|
|||||||
|
|
||||||
// stop shuts down the file watcher.
|
// stop shuts down the file watcher.
|
||||||
func (d *Discovery) stop() {
|
func (d *Discovery) stop() {
|
||||||
level.Debug(d.logger).Log("msg", "Stopping file discovery...", "paths", d.paths)
|
level.Debug(d.logger).Log("msg", "Stopping file discovery...", "paths", fmt.Sprintf("%v", d.paths))
|
||||||
|
|
||||||
done := make(chan struct{})
|
done := make(chan struct{})
|
||||||
defer close(done)
|
defer close(done)
|
||||||
@ -299,10 +299,10 @@ func (d *Discovery) stop() {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
if err := d.watcher.Close(); err != nil {
|
if err := d.watcher.Close(); err != nil {
|
||||||
level.Error(d.logger).Log("msg", "Error closing file watcher", "paths", d.paths, "err", err)
|
level.Error(d.logger).Log("msg", "Error closing file watcher", "paths", fmt.Sprintf("%v", d.paths), "err", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
level.Debug(d.logger).Log("File discovery stopped", "paths", d.paths)
|
level.Debug(d.logger).Log("msg", "File discovery stopped")
|
||||||
}
|
}
|
||||||
|
|
||||||
// refresh reads all files matching the discovery's patterns and sends the respective
|
// refresh reads all files matching the discovery's patterns and sends the respective
|
||||||
|
Loading…
Reference in New Issue
Block a user