diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2022-12-28 13:27:05 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2022-12-28 13:27:05 +0100 |
| commit | aa5c7fc159b0f5175ede96d46b8d2a2669a176a4 (patch) | |
| tree | 58964be878af574263b8d1994f3097860db2192e /youtube.go | |
| parent | e15e1c6a4cb4a534d649cfc3d1be68498fddac48 (diff) | |
| download | WRMS-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 'youtube.go')
| -rw-r--r-- | youtube.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -27,11 +27,11 @@ type YoutubeDlSearchResult struct { func (b *YoutubeBackend) Search(pattern string) []Song { searchOption := fmt.Sprintf("ytsearch%d:%s", b.searchResults, pattern) - llog.Debug(fmt.Sprintf("Search youtube using: youtube-dl -j %s", searchOption)) + llog.Debug("Search youtube using: youtube-dl -j %s", searchOption) results, err := exec.Command("youtube-dl", "-j", searchOption).Output() if err != nil { - llog.Error(fmt.Sprintf("youtube-dl failed with: %s", err)) + llog.Error("youtube-dl failed with: %s", err) } songs := []Song{} @@ -43,12 +43,12 @@ func (b *YoutubeBackend) Search(pattern string) []Song { result := YoutubeDlSearchResult{} err = json.Unmarshal([]byte(l), &result) if err != nil { - llog.Debug(fmt.Sprintf("Parsing youtube-dl results '%s' failed", l)) - llog.Error(fmt.Sprintf("Parsing youtube-dl results failed with: %s", err)) + llog.Debug("Parsing youtube-dl results '%s' failed", l) + llog.Error("Parsing youtube-dl results failed with: %s", err) } songs = append(songs, NewSong(result.Title, "", "youtube", result.Id)) } - llog.Debug(fmt.Sprintf("youtube found %d matching videos", len(songs))) + llog.Debug("youtube found %d matching videos", len(songs)) return songs } |
