log textfile directory on startup

This commit is contained in:
Hector 2021-10-12 20:53:27 +01:00
parent ac3681edb1
commit 172746eb71

View File

@ -3,6 +3,7 @@ package textfile
import (
"fail2ban-prometheus-exporter/cfg"
"github.com/prometheus/client_golang/prometheus"
"log"
)
type Collector struct {
@ -18,11 +19,15 @@ type fileData struct {
}
func NewCollector(appSettings *cfg.AppSettings) *Collector {
return &Collector{
collector := &Collector{
enabled: appSettings.FileCollectorEnabled,
folderPath: appSettings.FileCollectorPath,
fileMap: make(map[string]*fileData),
}
if collector.enabled {
log.Printf("collector.textfile directory: %s", collector.folderPath)
}
return collector
}
func (c *Collector) Describe(ch chan<- *prometheus.Desc) {