Maint: pass only single strings to logger methods

- Do not assume formatting from logger's interface
- Allow to change golibs in the future to accept only strings for logger methods
This commit is contained in:
Quentin McGaw (desktop)
2021-07-23 17:36:08 +00:00
parent 21f4cf7ab5
commit 3c44214d01
34 changed files with 134 additions and 127 deletions

View File

@@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
"reflect"
"strconv"
"github.com/qdm12/gluetun/internal/models"
)
@@ -48,12 +49,12 @@ func (s *storage) SyncServers(hardcodedServers models.AllServers) (
countOnFile := countServers(serversOnFile)
if countOnFile == 0 {
s.logger.Info("creating %s with %d hardcoded servers", s.filepath, hardcodedCount)
s.logger.Info("creating " + s.filepath + " with " + strconv.Itoa(hardcodedCount) + " hardcoded servers")
allServers = hardcodedServers
} else {
s.logger.Info(
"merging by most recent %d hardcoded servers and %d servers read from %s",
hardcodedCount, countOnFile, s.filepath)
s.logger.Info("merging by most recent " +
strconv.Itoa(hardcodedCount) + " hardcoded servers and " +
strconv.Itoa(countOnFile) + " servers read from " + s.filepath)
allServers = s.mergeServers(hardcodedServers, serversOnFile)
}