mirror of
https://github.com/eko/pihole-exporter.git
synced 2024-11-24 11:37:03 +01:00
Merge pull request #109 from Galorhallen/master
Removed print of token/password in logs
This commit is contained in:
commit
ca60f3a55e
@ -78,7 +78,11 @@ func (c *Config) String() string {
|
||||
for i := 0; i < fields.NumField(); i++ {
|
||||
valueField := fields.Field(i)
|
||||
typeField := fields.Type().Field(i)
|
||||
if typeField.Name != "PIHolePassword" && typeField.Name != "PIHoleApiToken" {
|
||||
buffer[i] = fmt.Sprintf("%s=%v", typeField.Name, valueField.Interface())
|
||||
} else if valueField.Len() > 0 {
|
||||
buffer[i] = fmt.Sprintf("%s=%s", typeField.Name, "*****")
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Sprintf("<Config@%X %s>", &c, strings.Join(buffer, ", "))
|
||||
|
@ -31,7 +31,7 @@ func NewClient(config *config.Config) *Client {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
fmt.Printf("Creating client with config %s\n", config)
|
||||
log.Printf("Creating client with config %s\n", config)
|
||||
|
||||
return &Client{
|
||||
config: config,
|
||||
|
3
main.go
3
main.go
@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/eko/pihole-exporter/config"
|
||||
@ -41,7 +40,7 @@ func main() {
|
||||
case <-serverDead:
|
||||
}
|
||||
|
||||
fmt.Println("pihole-exporter HTTP server stopped")
|
||||
log.Println("pihole-exporter HTTP server stopped")
|
||||
}
|
||||
|
||||
func buildClients(clientConfigs []config.Config) []*pihole.Client {
|
||||
|
Loading…
Reference in New Issue
Block a user