Demote some log.printf into log.tracef

This commit is contained in:
Eugene Bujak 2019-02-07 18:24:12 +03:00
parent 6e5731ab02
commit 68c8a4d484
6 changed files with 10 additions and 10 deletions

2
app.go
View File

@ -66,7 +66,7 @@ func run(args options) {
// print the first message after logger is configured // print the first message after logger is configured
log.Printf("AdGuard Home, version %s\n", VersionString) log.Printf("AdGuard Home, version %s\n", VersionString)
log.Printf("Current working directory is %s", config.ourBinaryDir) log.Tracef("Current working directory is %s", config.ourBinaryDir)
if args.runningAsService { if args.runningAsService {
log.Printf("AdGuard Home is running as a service") log.Printf("AdGuard Home is running as a service")
} }

View File

@ -115,7 +115,7 @@ func getLogSettings() logSettings {
// parseConfig loads configuration from the YAML file // parseConfig loads configuration from the YAML file
func parseConfig() error { func parseConfig() error {
configFile := config.getConfigFilename() configFile := config.getConfigFilename()
log.Printf("Reading YAML file: %s", configFile) log.Tracef("Reading YAML file: %s", configFile)
yamlFile, err := readConfigFile() yamlFile, err := readConfigFile()
if err != nil { if err != nil {
log.Printf("Couldn't read config file: %s", err) log.Printf("Couldn't read config file: %s", err)
@ -158,7 +158,7 @@ func (c *configuration) write() error {
return nil return nil
} }
configFile := config.getConfigFilename() configFile := config.getConfigFilename()
log.Printf("Writing YAML file: %s", configFile) log.Tracef("Writing YAML file: %s", configFile)
yamlText, err := yaml.Marshal(&config) yamlText, err := yaml.Marshal(&config)
if err != nil { if err != nil {
log.Printf("Couldn't generate YAML file: %s", err) log.Printf("Couldn't generate YAML file: %s", err)

View File

@ -31,11 +31,11 @@ func getIfaceIPv4(iface *net.Interface) *net.IPNet {
} }
if ipnet.IP.To4() == nil { if ipnet.IP.To4() == nil {
log.Printf("Got IP that is not IPv4: %v", ipnet.IP) log.Tracef("Got IP that is not IPv4: %v", ipnet.IP)
continue continue
} }
log.Printf("Got IP that is IPv4: %v", ipnet.IP) log.Tracef("Got IP that is IPv4: %v", ipnet.IP)
return &net.IPNet{ return &net.IPNet{
IP: ipnet.IP.To4(), IP: ipnet.IP.To4(),
Mask: ipnet.Mask, Mask: ipnet.Mask,

View File

@ -110,7 +110,7 @@ func (s *Server) startInternal(config *ServerConfig) error {
return err return err
} }
log.Printf("Loading stats from querylog") log.Tracef("Loading stats from querylog")
err = fillStatsFromQueryLog() err = fillStatsFromQueryLog()
if err != nil { if err != nil {
return errorx.Decorate(err, "failed to load stats from querylog") return errorx.Decorate(err, "failed to load stats from querylog")
@ -152,7 +152,7 @@ func (s *Server) startInternal(config *ServerConfig) error {
// Initializes the DNS filter // Initializes the DNS filter
func (s *Server) initDNSFilter() error { func (s *Server) initDNSFilter() error {
log.Printf("Creating dnsfilter") log.Tracef("Creating dnsfilter")
s.dnsFilter = dnsfilter.New(&s.Config) s.dnsFilter = dnsfilter.New(&s.Config)
// add rules only if they are enabled // add rules only if they are enabled
if s.FilteringEnabled { if s.FilteringEnabled {

View File

@ -228,7 +228,7 @@ func (filter *filter) load() error {
} }
filterFilePath := filter.Path() filterFilePath := filter.Path()
log.Printf("Loading filter %d contents to: %s", filter.ID, filterFilePath) log.Tracef("Loading filter %d contents to: %s", filter.ID, filterFilePath)
if _, err := os.Stat(filterFilePath); os.IsNotExist(err) { if _, err := os.Stat(filterFilePath); os.IsNotExist(err) {
// do nothing, file doesn't exist // do nothing, file doesn't exist
@ -240,7 +240,7 @@ func (filter *filter) load() error {
return err return err
} }
log.Printf("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents)) log.Tracef("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents))
rulesCount, _, rules := parseFilterContents(filterFileContents) rulesCount, _, rules := parseFilterContents(filterFileContents)
filter.RulesCount = rulesCount filter.RulesCount = rulesCount

View File

@ -34,7 +34,7 @@ func upgradeConfig() error {
} }
schemaVersionInterface, ok := diskConfig["schema_version"] schemaVersionInterface, ok := diskConfig["schema_version"]
log.Printf("%s(): got schema version %v", _Func(), schemaVersionInterface) log.Tracef("got schema version %v", schemaVersionInterface)
if !ok { if !ok {
// no schema version, set it to 0 // no schema version, set it to 0
schemaVersionInterface = 0 schemaVersionInterface = 0