Demote some log.printf into log.tracef
This commit is contained in:
parent
6e5731ab02
commit
68c8a4d484
2
app.go
2
app.go
|
@ -66,7 +66,7 @@ func run(args options) {
|
|||
|
||||
// print the first message after logger is configured
|
||||
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 {
|
||||
log.Printf("AdGuard Home is running as a service")
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ func getLogSettings() logSettings {
|
|||
// parseConfig loads configuration from the YAML file
|
||||
func parseConfig() error {
|
||||
configFile := config.getConfigFilename()
|
||||
log.Printf("Reading YAML file: %s", configFile)
|
||||
log.Tracef("Reading YAML file: %s", configFile)
|
||||
yamlFile, err := readConfigFile()
|
||||
if err != nil {
|
||||
log.Printf("Couldn't read config file: %s", err)
|
||||
|
@ -158,7 +158,7 @@ func (c *configuration) write() error {
|
|||
return nil
|
||||
}
|
||||
configFile := config.getConfigFilename()
|
||||
log.Printf("Writing YAML file: %s", configFile)
|
||||
log.Tracef("Writing YAML file: %s", configFile)
|
||||
yamlText, err := yaml.Marshal(&config)
|
||||
if err != nil {
|
||||
log.Printf("Couldn't generate YAML file: %s", err)
|
||||
|
|
|
@ -31,11 +31,11 @@ func getIfaceIPv4(iface *net.Interface) *net.IPNet {
|
|||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
log.Printf("Got IP that is IPv4: %v", ipnet.IP)
|
||||
log.Tracef("Got IP that is IPv4: %v", ipnet.IP)
|
||||
return &net.IPNet{
|
||||
IP: ipnet.IP.To4(),
|
||||
Mask: ipnet.Mask,
|
||||
|
|
|
@ -110,7 +110,7 @@ func (s *Server) startInternal(config *ServerConfig) error {
|
|||
return err
|
||||
}
|
||||
|
||||
log.Printf("Loading stats from querylog")
|
||||
log.Tracef("Loading stats from querylog")
|
||||
err = fillStatsFromQueryLog()
|
||||
if err != nil {
|
||||
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
|
||||
func (s *Server) initDNSFilter() error {
|
||||
log.Printf("Creating dnsfilter")
|
||||
log.Tracef("Creating dnsfilter")
|
||||
s.dnsFilter = dnsfilter.New(&s.Config)
|
||||
// add rules only if they are enabled
|
||||
if s.FilteringEnabled {
|
||||
|
|
|
@ -228,7 +228,7 @@ func (filter *filter) load() error {
|
|||
}
|
||||
|
||||
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) {
|
||||
// do nothing, file doesn't exist
|
||||
|
@ -240,7 +240,7 @@ func (filter *filter) load() error {
|
|||
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)
|
||||
|
||||
filter.RulesCount = rulesCount
|
||||
|
|
|
@ -34,7 +34,7 @@ func upgradeConfig() error {
|
|||
}
|
||||
|
||||
schemaVersionInterface, ok := diskConfig["schema_version"]
|
||||
log.Printf("%s(): got schema version %v", _Func(), schemaVersionInterface)
|
||||
log.Tracef("got schema version %v", schemaVersionInterface)
|
||||
if !ok {
|
||||
// no schema version, set it to 0
|
||||
schemaVersionInterface = 0
|
||||
|
|
Loading…
Reference in New Issue