Overhaul logging.
This commit is contained in:
@@ -40,7 +40,7 @@ bool SDLAudioDriver::Initialize() {
|
||||
if ((ver.major < 2) ||
|
||||
(ver.major == 2 && ver.minor == 0 && ver.patch < 8)) {
|
||||
XELOGW(
|
||||
"SDL library version %d.%d.%d is outdated. "
|
||||
"SDL library version {}.{}.{} is outdated. "
|
||||
"You may experience choppy audio.",
|
||||
ver.major, ver.minor, ver.patch);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ bool XAudio2AudioDriver::Initialize() {
|
||||
}
|
||||
hr = xaudio2_create(&objects_.api_2_8.audio, 0, processor);
|
||||
if (FAILED(hr)) {
|
||||
XELOGE("XAudio2Create failed with %.8X", hr);
|
||||
XELOGE("XAudio2Create failed with {:08X}", hr);
|
||||
assert_always();
|
||||
return false;
|
||||
}
|
||||
@@ -104,13 +104,13 @@ bool XAudio2AudioDriver::Initialize() {
|
||||
hr = CoCreateInstance(__uuidof(api::XAudio2_7), NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_PPV_ARGS(&objects_.api_2_7.audio));
|
||||
if (FAILED(hr)) {
|
||||
XELOGE("CoCreateInstance for XAudio2 failed with %.8X", hr);
|
||||
XELOGE("CoCreateInstance for XAudio2 failed with {:08X}", hr);
|
||||
assert_always();
|
||||
return false;
|
||||
}
|
||||
hr = objects_.api_2_7.audio->Initialize(0, processor);
|
||||
if (FAILED(hr)) {
|
||||
XELOGE("IXAudio2::Initialize failed with %.8X", hr);
|
||||
XELOGE("IXAudio2::Initialize failed with {:08X}", hr);
|
||||
assert_always();
|
||||
return false;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ bool XAudio2AudioDriver::InitializeObjects(Objects& objects) {
|
||||
|
||||
hr = objects.audio->CreateMasteringVoice(&objects.mastering_voice);
|
||||
if (FAILED(hr)) {
|
||||
XELOGE("IXAudio2::CreateMasteringVoice failed with %.8X", hr);
|
||||
XELOGE("IXAudio2::CreateMasteringVoice failed with {:08X}", hr);
|
||||
assert_always();
|
||||
return false;
|
||||
}
|
||||
@@ -171,14 +171,14 @@ bool XAudio2AudioDriver::InitializeObjects(Objects& objects) {
|
||||
0, // api::XE_XAUDIO2_VOICE_NOSRC | api::XE_XAUDIO2_VOICE_NOPITCH,
|
||||
api::XE_XAUDIO2_MAX_FREQ_RATIO, voice_callback_);
|
||||
if (FAILED(hr)) {
|
||||
XELOGE("IXAudio2::CreateSourceVoice failed with %.8X", hr);
|
||||
XELOGE("IXAudio2::CreateSourceVoice failed with {:08X}", hr);
|
||||
assert_always();
|
||||
return false;
|
||||
}
|
||||
|
||||
hr = objects.pcm_voice->Start();
|
||||
if (FAILED(hr)) {
|
||||
XELOGE("IXAudio2SourceVoice::Start failed with %.8X", hr);
|
||||
XELOGE("IXAudio2SourceVoice::Start failed with {:08X}", hr);
|
||||
assert_always();
|
||||
return false;
|
||||
}
|
||||
@@ -231,7 +231,7 @@ void XAudio2AudioDriver::SubmitFrame(uint32_t frame_ptr) {
|
||||
hr = objects_.api_2_7.pcm_voice->SubmitSourceBuffer(&buffer);
|
||||
}
|
||||
if (FAILED(hr)) {
|
||||
XELOGE("SubmitSourceBuffer failed with %.8X", hr);
|
||||
XELOGE("SubmitSourceBuffer failed with {:08X}", hr);
|
||||
assert_always();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ void XmaContext::Enable() {
|
||||
auto context_ptr = memory()->TranslateVirtual(guest_ptr());
|
||||
XMA_CONTEXT_DATA data(context_ptr);
|
||||
|
||||
XELOGAPU("XmaContext: kicking context %d (buffer %d %d/%d bits)", id(),
|
||||
XELOGAPU("XmaContext: kicking context {} (buffer {} {}/{} bits)", id(),
|
||||
data.current_buffer, data.input_buffer_read_offset,
|
||||
(data.current_buffer == 0 ? data.input_buffer_0_packet_count
|
||||
: data.input_buffer_1_packet_count) *
|
||||
@@ -143,7 +143,7 @@ bool XmaContext::Block(bool poll) {
|
||||
|
||||
void XmaContext::Clear() {
|
||||
std::lock_guard<std::mutex> lock(lock_);
|
||||
XELOGAPU("XmaContext: reset context %d", id());
|
||||
XELOGAPU("XmaContext: reset context {}", id());
|
||||
|
||||
auto context_ptr = memory()->TranslateVirtual(guest_ptr());
|
||||
XMA_CONTEXT_DATA data(context_ptr);
|
||||
@@ -160,7 +160,7 @@ void XmaContext::Clear() {
|
||||
|
||||
void XmaContext::Disable() {
|
||||
std::lock_guard<std::mutex> lock(lock_);
|
||||
XELOGAPU("XmaContext: disabling context %d", id());
|
||||
XELOGAPU("XmaContext: disabling context {}", id());
|
||||
set_is_enabled(false);
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA* data) {
|
||||
: nullptr;
|
||||
uint8_t* current_input_buffer = data->current_buffer ? in1 : in0;
|
||||
|
||||
XELOGAPU("Processing context %d (offset %d, buffer %d, ptr %.8X)", id(),
|
||||
XELOGAPU("Processing context {} (offset {}, buffer {}, ptr {:p})", id(),
|
||||
data->input_buffer_read_offset, data->current_buffer,
|
||||
current_input_buffer);
|
||||
|
||||
@@ -392,7 +392,7 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA* data) {
|
||||
|
||||
if (!ValidFrameOffset(current_input_buffer, current_input_size,
|
||||
data->input_buffer_read_offset)) {
|
||||
XELOGAPU("XmaContext %d: Invalid read offset %d!", id(),
|
||||
XELOGAPU("XmaContext {}: Invalid read offset {}!", id(),
|
||||
data->input_buffer_read_offset);
|
||||
if (data->current_buffer == 0) {
|
||||
data->current_buffer = 1;
|
||||
@@ -441,7 +441,7 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA* data) {
|
||||
}
|
||||
|
||||
if (partial_frame_saved_) {
|
||||
XELOGAPU("XmaContext %d: saved a partial frame", id());
|
||||
XELOGAPU("XmaContext {}: saved a partial frame", id());
|
||||
|
||||
if (data->current_buffer == 0) {
|
||||
data->input_buffer_0_valid = 0;
|
||||
@@ -485,7 +485,7 @@ void XmaContext::DecodePackets(XMA_CONTEXT_DATA* data) {
|
||||
bool partial = false;
|
||||
size_t bit_offset = data->input_buffer_read_offset;
|
||||
if (partial_frame_saved_) {
|
||||
XELOGAPU("XmaContext %d: processing saved partial frame", id());
|
||||
XELOGAPU("XmaContext {}: processing saved partial frame", id());
|
||||
packet_->data = partial_frame_buffer_.data();
|
||||
packet_->size = (int)partial_frame_buffer_.size();
|
||||
|
||||
|
||||
@@ -91,7 +91,8 @@ void av_log_callback(void* avcl, int level, const char* fmt, va_list va) {
|
||||
|
||||
StringBuffer buff;
|
||||
buff.AppendVarargs(fmt, va);
|
||||
xe::LogLineFormat(log_level, level_char, "libav: %s", buff.buffer());
|
||||
xe::logging::AppendLogLineFormat(log_level, level_char, "libav: {}",
|
||||
buff.to_string_view());
|
||||
}
|
||||
|
||||
X_STATUS XmaDecoder::Setup(kernel::KernelState* kernel_state) {
|
||||
@@ -248,7 +249,7 @@ uint32_t XmaDecoder::ReadRegister(uint32_t addr) {
|
||||
switch (r) {
|
||||
default: {
|
||||
if (!register_file_.GetRegisterInfo(r)) {
|
||||
XELOGE("XMA: Read from unknown register (%.4X)", r);
|
||||
XELOGE("XMA: Read from unknown register ({:04X})", r);
|
||||
}
|
||||
}
|
||||
#pragma warning(suppress : 4065)
|
||||
@@ -285,7 +286,7 @@ void XmaDecoder::WriteRegister(uint32_t addr, uint32_t value) {
|
||||
} else {
|
||||
switch (r) {
|
||||
default: {
|
||||
XELOGE("XMA: Write to unhandled register (%.4X): %.8X", r, value);
|
||||
XELOGE("XMA: Write to unhandled register ({:04X}): {:08X}", r, value);
|
||||
break;
|
||||
}
|
||||
#pragma warning(suppress : 4065)
|
||||
|
||||
Reference in New Issue
Block a user