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