Skip to content

Commit b234322

Browse files
authored
Fix logger vet format warnings (#91)
1 parent ba4cbda commit b234322

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

adb/collector.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (c *Collector) Find(path string) ([]FileInfo, error) {
149149
if !c.isInstalled() {
150150
err := c.Install()
151151
if err != nil {
152-
log.Debugf("Impossible to install collector: %w", err)
152+
log.Debugf("Impossible to install collector: %v", err)
153153
return results, err
154154
}
155155
}
@@ -175,7 +175,7 @@ func (c *Collector) FindHash(path string) ([]FileInfo, error) {
175175
if !c.isInstalled() {
176176
err := c.Install()
177177
if err != nil {
178-
log.Debugf("Impossible to install collector: %w", err)
178+
log.Debugf("Impossible to install collector: %v", err)
179179
return results, err
180180
}
181181
}
@@ -200,7 +200,7 @@ func (c *Collector) Processes() ([]ProcessInfo, error) {
200200
if c.isInstalled() {
201201
err := c.Install()
202202
if err != nil {
203-
log.Debugf("Impossible to install collector: %w", err)
203+
log.Debugf("Impossible to install collector: %v", err)
204204
return results, err
205205
}
206206
}

log/logger.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,31 +206,31 @@ func CloseFileLog() {
206206
}
207207

208208
func Debug(v ...any) {
209-
log.out(DEBUG, "", v...)
209+
log.out(DEBUG, "%s", fmt.Sprint(v...))
210210
}
211211

212212
func Debugf(format string, v ...any) {
213213
log.out(DEBUG, format, v...)
214214
}
215215

216216
func Info(v ...any) {
217-
log.out(INFO, "", v...)
217+
log.out(INFO, "%s", fmt.Sprint(v...))
218218
}
219219

220220
func Infof(format string, v ...any) {
221221
log.out(INFO, format, v...)
222222
}
223223

224224
func Warning(v ...any) {
225-
log.out(WARNING, "", v...)
225+
log.out(WARNING, "%s", fmt.Sprint(v...))
226226
}
227227

228228
func Warningf(format string, v ...any) {
229229
log.out(WARNING, format, v...)
230230
}
231231

232232
func Error(v ...any) {
233-
log.out(ERROR, "", v...)
233+
log.out(ERROR, "%s", fmt.Sprint(v...))
234234
}
235235

236236
func Errorf(format string, v ...any) {
@@ -242,15 +242,15 @@ func ErrorExc(desc string, err error) {
242242
}
243243

244244
func Critical(v ...any) {
245-
log.out(CRITICAL, "", v...)
245+
log.out(CRITICAL, "%s", fmt.Sprint(v...))
246246
}
247247

248248
func Criticalf(format string, v ...any) {
249249
log.out(CRITICAL, format, v...)
250250
}
251251

252252
func Fatal(v ...any) {
253-
log.out(FATAL, "", v...)
253+
log.out(FATAL, "%s", fmt.Sprint(v...))
254254
os.Exit(1)
255255
}
256256

modules/bugreport.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (b *Bugreport) Run(acq *acquisition.Acquisition, fast bool) error {
4747
bugreportPath := filepath.Join(b.StoragePath, "bugreport.zip")
4848
err := adb.Client.Bugreport(bugreportPath)
4949
if err != nil {
50-
log.Debugf("Impossible to generate bugreport: %w", err)
50+
log.Debugf("Impossible to generate bugreport: %v", err)
5151
return err
5252
}
5353
}

modules/logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (l *Logs) Run(acq *acquisition.Acquisition, fast bool) error {
5858
for _, logFolder := range []string{"/data/anr/", "/data/log/", "/sdcard/log/"} {
5959
files, err := adb.Client.ListFiles(logFolder, true)
6060
if err != nil {
61-
log.Debugf("Impossible to get files from %", logFolder)
61+
log.Debugf("Impossible to get files from %s", logFolder)
6262
continue
6363
}
6464
if len(files) == 0 {

0 commit comments

Comments
 (0)