Log: remove the obsolete printf-style functions

This commit is contained in:
Max Kellermann
2021-10-13 16:08:48 +02:00
parent 2fbbd540bb
commit 72f6e018e7
17 changed files with 102 additions and 283 deletions

View File

@@ -21,11 +21,15 @@
#include "MixerControl.hxx"
#include "MixerInternal.hxx"
#include "MixerList.hxx"
#include "lib/fmt/ExceptionFormatter.hxx"
#include "pcm/Volume.hxx"
#include "util/Domain.hxx"
#include "Log.hxx"
#include <cassert>
static constexpr Domain mixer_domain("mixer");
gcc_pure
static int
output_mixer_get_volume(const AudioOutputControl &ao) noexcept
@@ -40,9 +44,9 @@ output_mixer_get_volume(const AudioOutputControl &ao) noexcept
try {
return mixer_get_volume(mixer);
} catch (...) {
FormatError(std::current_exception(),
"Failed to read mixer for '%s'",
ao.GetName());
FmtError(mixer_domain,
"Failed to read mixer for '{}': {}",
ao.GetName(), std::current_exception());
return -1;
}
}
@@ -83,9 +87,9 @@ output_mixer_set_volume(AudioOutputControl &ao, unsigned volume) noexcept
mixer_set_volume(mixer, volume);
return true;
} catch (...) {
FormatError(std::current_exception(),
"Failed to set mixer for '%s'",
ao.GetName());
FmtError(mixer_domain,
"Failed to set mixer for '{}': {}",
ao.GetName(), std::current_exception());
return false;
}
}