Partition, ...: use libfmt for logging

This commit is contained in:
Max Kellermann
2021-06-24 20:22:48 +02:00
parent 0185d58a2b
commit 6f539cfcd6
44 changed files with 320 additions and 296 deletions

View File

@@ -207,7 +207,8 @@ input_cdio_open(const char *uri,
cdio_cddap_verbose_set(drv, CDDA_MESSAGE_FORGETIT, CDDA_MESSAGE_FORGETIT);
if (speed > 0) {
FormatDebug(cdio_domain,"Attempting to set CD speed to %dx",speed);
FmtDebug(cdio_domain, "Attempting to set CD speed to {}x",
speed);
cdio_cddap_speed_set(drv,speed);
}
@@ -301,8 +302,8 @@ CdioParanoiaInputStream::Read(std::unique_lock<Mutex> &,
} catch (...) {
char *s_err = cdio_cddap_errors(drv);
if (s_err) {
FormatError(cdio_domain,
"paranoia_read: %s", s_err);
FmtError(cdio_domain,
"paranoia_read: {}", s_err);
cdio_cddap_free_messages(s_err);
}

View File

@@ -27,10 +27,10 @@
#include "input/ProxyInputStream.hxx"
#include "input/FailingInputStream.hxx"
#include "input/InputPlugin.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "config/Block.hxx"
#include "thread/Mutex.hxx"
#include "util/Domain.hxx"
#include "util/Exception.hxx"
#include "util/StringCompare.hxx"
#include "Log.hxx"
@@ -117,8 +117,8 @@ TidalInputStream::OnTidalSession() noexcept
void
TidalInputStream::OnTidalTrackSuccess(std::string url) noexcept
{
FormatDebug(tidal_domain, "Tidal track '%s' resolves to %s",
track_id.c_str(), url.c_str());
FmtDebug(tidal_domain, "Tidal track '{}' resolves to {}",
track_id, url);
const std::lock_guard<Mutex> protect(mutex);
@@ -154,8 +154,8 @@ TidalInputStream::OnTidalTrackError(std::exception_ptr e) noexcept
/* the session has expired - obtain a new session id
by logging in again */
FormatInfo(tidal_domain, "Session expired ('%s'), retrying to log in",
GetFullMessage(e).c_str());
FmtInfo(tidal_domain,
"Session expired ('{}'), retrying to log in", e);
retry_login = false;
tidal_session->AddLoginHandler(*this);