aboutsummaryrefslogtreecommitdiff
path: root/localBackend.go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2022-12-28 13:27:05 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2022-12-28 13:27:05 +0100
commitaa5c7fc159b0f5175ede96d46b8d2a2669a176a4 (patch)
tree58964be878af574263b8d1994f3097860db2192e /localBackend.go
parente15e1c6a4cb4a534d649cfc3d1be68498fddac48 (diff)
downloadWRMS-aa5c7fc159b0f5175ede96d46b8d2a2669a176a4.tar.gz
WRMS-aa5c7fc159b0f5175ede96d46b8d2a2669a176a4.zip
llog: use variable argument list
Mirror more closely the fmt interface and reduce the verbosity of the log call sites. Additionally the log message is only created if we are actually going to log it.
Diffstat (limited to 'localBackend.go')
-rw-r--r--localBackend.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/localBackend.go b/localBackend.go
index a09d9a1..2dbd4fd 100644
--- a/localBackend.go
+++ b/localBackend.go
@@ -1,14 +1,14 @@
package main
import (
- "fmt"
- "github.com/dhowden/tag"
- "muhq.space/go/wrms/llog"
"os"
"path"
"path/filepath"
"strings"
"sync"
+
+ "github.com/dhowden/tag"
+ "muhq.space/go/wrms/llog"
)
type LocalBackend struct {
@@ -31,7 +31,7 @@ func (b *LocalBackend) insert(song *Song) {
}
func (b *LocalBackend) findSongs() {
- llog.Debug(fmt.Sprintf("Starting song search under: %s", b.musicDir))
+ llog.Debug("Starting song search under: %s", b.musicDir)
// Insert some Songs
song := NewSong("No!", "Bukahara", "local", "Bukahara/Phantasma/01-No!.ogg")
@@ -42,7 +42,7 @@ func (b *LocalBackend) findSongs() {
err := filepath.Walk(b.musicDir, func(p string, finfo os.FileInfo, err error) error {
if err != nil {
- llog.Warning(fmt.Sprintf("error %v at path %s\n", err, p))
+ llog.Warning("error %v at path %s\n", err, p)
return err
}
@@ -60,13 +60,13 @@ func (b *LocalBackend) findSongs() {
f, err := os.Open(p)
defer f.Close()
if err != nil {
- llog.Warning(fmt.Sprintf("error %v opening file %s", err, p))
+ llog.Warning("error %v opening file %s", err, p)
return err
}
m, err := tag.ReadFrom(f)
if err != nil {
- llog.Warning(fmt.Sprintf("error reading tags from %s: %v", p, err))
+ llog.Warning("error reading tags from %s: %v", p, err)
// Contiune walking
return nil
}
@@ -77,7 +77,7 @@ func (b *LocalBackend) findSongs() {
})
if err != nil {
- llog.Error(fmt.Sprintf("error walking the path %q: %v", b.musicDir, err))
+ llog.Error("error walking the path %q: %v", b.musicDir, err)
}
}