AudioCommon: Migrate logging over to fmt

printf specifiers, begone!
This commit is contained in:
Lioncash
2020-10-21 13:32:25 -04:00
parent 09e87b79f1
commit 22a79289d3
9 changed files with 69 additions and 70 deletions

View File

@ -22,7 +22,7 @@ bool PulseAudio::Init()
m_stereo = !SConfig::GetInstance().ShouldUseDPL2Decoder();
m_channels = m_stereo ? 2 : 6; // will tell PA we use a Stereo or 5.0 channel setup
NOTICE_LOG(AUDIO, "PulseAudio backend using %d channels", m_channels);
NOTICE_LOG_FMT(AUDIO, "PulseAudio backend using {} channels", m_channels);
m_run_thread.Set();
m_thread = std::thread(&PulseAudio::SoundLoop, this);
@ -47,7 +47,7 @@ void PulseAudio::SoundLoop()
m_pa_error = pa_mainloop_iterate(m_pa_ml, 1, nullptr);
if (m_pa_error < 0)
ERROR_LOG(AUDIO, "PulseAudio error: %s", pa_strerror(m_pa_error));
ERROR_LOG_FMT(AUDIO, "PulseAudio error: {}", pa_strerror(m_pa_error));
PulseShutdown();
}
@ -73,7 +73,7 @@ bool PulseAudio::PulseInit()
if (m_pa_connected == 2 || m_pa_error < 0)
{
ERROR_LOG(AUDIO, "PulseAudio failed to initialize: %s", pa_strerror(m_pa_error));
ERROR_LOG_FMT(AUDIO, "PulseAudio failed to initialize: {}", pa_strerror(m_pa_error));
return false;
}
@ -123,11 +123,11 @@ bool PulseAudio::PulseInit()
m_pa_error = pa_stream_connect_playback(m_pa_s, nullptr, &m_pa_ba, flags, nullptr, nullptr);
if (m_pa_error < 0)
{
ERROR_LOG(AUDIO, "PulseAudio failed to initialize: %s", pa_strerror(m_pa_error));
ERROR_LOG_FMT(AUDIO, "PulseAudio failed to initialize: {}", pa_strerror(m_pa_error));
return false;
}
INFO_LOG(AUDIO, "Pulse successfully initialized");
INFO_LOG_FMT(AUDIO, "Pulse successfully initialized");
return true;
}
@ -161,7 +161,7 @@ void PulseAudio::UnderflowCallback(pa_stream* s)
pa_operation* op = pa_stream_set_buffer_attr(s, &m_pa_ba, nullptr, nullptr);
pa_operation_unref(op);
WARN_LOG(AUDIO, "pulseaudio underflow, new latency: %d bytes", m_pa_ba.tlength);
WARN_LOG_FMT(AUDIO, "pulseaudio underflow, new latency: {} bytes", m_pa_ba.tlength);
}
void PulseAudio::WriteCallback(pa_stream* s, size_t length)
@ -190,7 +190,7 @@ void PulseAudio::WriteCallback(pa_stream* s, size_t length)
}
else
{
ERROR_LOG(AUDIO, "Unsupported number of PA channels requested: %d", (int)m_channels);
ERROR_LOG_FMT(AUDIO, "Unsupported number of PA channels requested: {}", m_channels);
return;
}
}