service/ir: Migrate logging macros

This commit is contained in:
NarcolepticK 2018-06-20 01:09:50 -04:00
parent fa5d247b43
commit 8c08678606
3 changed files with 31 additions and 31 deletions

View file

@ -165,8 +165,8 @@ void ExtraHID::OnDisconnect() {
void ExtraHID::HandleConfigureHIDPollingRequest(const std::vector<u8>& request) { void ExtraHID::HandleConfigureHIDPollingRequest(const std::vector<u8>& request) {
if (request.size() != 3) { if (request.size() != 3) {
LOG_ERROR(Service_IR, "Wrong request size (%zu): %s", request.size(), NGLOG_ERROR(Service_IR, "Wrong request size ({}): {}", request.size(),
Common::ArrayToString(request.data(), request.size()).c_str()); Common::ArrayToString(request.data(), request.size()));
return; return;
} }
@ -187,8 +187,8 @@ void ExtraHID::HandleReadCalibrationDataRequest(const std::vector<u8>& request_b
"ReadCalibrationDataRequest has wrong size"); "ReadCalibrationDataRequest has wrong size");
if (request_buf.size() != sizeof(ReadCalibrationDataRequest)) { if (request_buf.size() != sizeof(ReadCalibrationDataRequest)) {
LOG_ERROR(Service_IR, "Wrong request size (%zu): %s", request_buf.size(), NGLOG_ERROR(Service_IR, "Wrong request size ({}): {}", request_buf.size(),
Common::ArrayToString(request_buf.data(), request_buf.size()).c_str()); Common::ArrayToString(request_buf.data(), request_buf.size()));
return; return;
} }
@ -199,8 +199,8 @@ void ExtraHID::HandleReadCalibrationDataRequest(const std::vector<u8>& request_b
const u16 size = Common::AlignDown(request.size, 16); const u16 size = Common::AlignDown(request.size, 16);
if (offset + size > calibration_data.size()) { if (offset + size > calibration_data.size()) {
LOG_ERROR(Service_IR, "Read beyond the end of calibration data! (offset=%u, size=%u)", NGLOG_ERROR(Service_IR, "Read beyond the end of calibration data! (offset={}, size={})",
offset, size); offset, size);
return; return;
} }
@ -222,8 +222,8 @@ void ExtraHID::OnReceive(const std::vector<u8>& data) {
HandleReadCalibrationDataRequest(data); HandleReadCalibrationDataRequest(data);
break; break;
default: default:
LOG_ERROR(Service_IR, "Unknown request: %s", NGLOG_ERROR(Service_IR, "Unknown request: {}",
Common::ArrayToString(data.data(), data.size()).c_str()); Common::ArrayToString(data.data(), data.size()));
break; break;
} }
} }

View file

@ -122,7 +122,7 @@ void IR_RST::Initialize(Kernel::HLERequestContext& ctx) {
raw_c_stick = rp.Pop<bool>(); raw_c_stick = rp.Pop<bool>();
if (raw_c_stick) if (raw_c_stick)
LOG_ERROR(Service_IR, "raw C-stick data is not implemented!"); NGLOG_ERROR(Service_IR, "raw C-stick data is not implemented!");
next_pad_index = 0; next_pad_index = 0;
is_device_reload_pending.store(true); is_device_reload_pending.store(true);
@ -131,7 +131,7 @@ void IR_RST::Initialize(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_DEBUG(Service_IR, "called. update_period=%d, raw_c_stick=%d", update_period, raw_c_stick); NGLOG_DEBUG(Service_IR, "called. update_period={}, raw_c_stick={}", update_period, raw_c_stick);
} }
void IR_RST::Shutdown(Kernel::HLERequestContext& ctx) { void IR_RST::Shutdown(Kernel::HLERequestContext& ctx) {
@ -142,7 +142,7 @@ void IR_RST::Shutdown(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_DEBUG(Service_IR, "called"); NGLOG_DEBUG(Service_IR, "called");
} }
IR_RST::IR_RST() : ServiceFramework("ir:rst", 1) { IR_RST::IR_RST() : ServiceFramework("ir:rst", 1) {

View file

@ -183,8 +183,8 @@ private:
/// Wraps the payload into packet and puts it to the receive buffer /// Wraps the payload into packet and puts it to the receive buffer
void IR_USER::PutToReceive(const std::vector<u8>& payload) { void IR_USER::PutToReceive(const std::vector<u8>& payload) {
LOG_TRACE(Service_IR, "called, data=%s", NGLOG_TRACE(Service_IR, "called, data={}",
Common::ArrayToString(payload.data(), payload.size()).c_str()); Common::ArrayToString(payload.data(), payload.size()));
size_t size = payload.size(); size_t size = payload.size();
std::vector<u8> packet; std::vector<u8> packet;
@ -225,7 +225,7 @@ void IR_USER::PutToReceive(const std::vector<u8>& payload) {
if (receive_buffer->Put(packet)) { if (receive_buffer->Put(packet)) {
receive_event->Signal(); receive_event->Signal();
} else { } else {
LOG_ERROR(Service_IR, "receive buffer is full!"); NGLOG_ERROR(Service_IR, "receive buffer is full!");
} }
} }
@ -251,12 +251,12 @@ void IR_USER::InitializeIrNopShared(Kernel::HLERequestContext& ctx) {
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_INFO(Service_IR, NGLOG_INFO(Service_IR,
"called, shared_buff_size=%u, recv_buff_size=%u, " "called, shared_buff_size={}, recv_buff_size={}, "
"recv_buff_packet_count=%u, send_buff_size=%u, " "recv_buff_packet_count={}, send_buff_size={}, "
"send_buff_packet_count=%u, baud_rate=%u", "send_buff_packet_count={}, baud_rate={}",
shared_buff_size, recv_buff_size, recv_buff_packet_count, send_buff_size, shared_buff_size, recv_buff_size, recv_buff_packet_count, send_buff_size,
send_buff_packet_count, baud_rate); send_buff_packet_count, baud_rate);
} }
void IR_USER::RequireConnection(Kernel::HLERequestContext& ctx) { void IR_USER::RequireConnection(Kernel::HLERequestContext& ctx) {
@ -275,7 +275,7 @@ void IR_USER::RequireConnection(Kernel::HLERequestContext& ctx) {
connected_device->OnConnect(); connected_device->OnConnect();
conn_status_event->Signal(); conn_status_event->Signal();
} else { } else {
LOG_WARNING(Service_IR, "unknown device id %u. Won't connect.", device_id); NGLOG_WARNING(Service_IR, "unknown device id {}. Won't connect.", device_id);
shared_memory_ptr[offsetof(SharedMemoryHeader, connection_status)] = 1; shared_memory_ptr[offsetof(SharedMemoryHeader, connection_status)] = 1;
shared_memory_ptr[offsetof(SharedMemoryHeader, trying_to_connect_status)] = 2; shared_memory_ptr[offsetof(SharedMemoryHeader, trying_to_connect_status)] = 2;
} }
@ -283,7 +283,7 @@ void IR_USER::RequireConnection(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_INFO(Service_IR, "called, device_id = %u", device_id); NGLOG_INFO(Service_IR, "called, device_id = {}", device_id);
} }
void IR_USER::GetReceiveEvent(Kernel::HLERequestContext& ctx) { void IR_USER::GetReceiveEvent(Kernel::HLERequestContext& ctx) {
@ -292,7 +292,7 @@ void IR_USER::GetReceiveEvent(Kernel::HLERequestContext& ctx) {
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(receive_event); rb.PushCopyObjects(receive_event);
LOG_INFO(Service_IR, "called"); NGLOG_INFO(Service_IR, "called");
} }
void IR_USER::GetSendEvent(Kernel::HLERequestContext& ctx) { void IR_USER::GetSendEvent(Kernel::HLERequestContext& ctx) {
@ -301,7 +301,7 @@ void IR_USER::GetSendEvent(Kernel::HLERequestContext& ctx) {
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(send_event); rb.PushCopyObjects(send_event);
LOG_INFO(Service_IR, "called"); NGLOG_INFO(Service_IR, "called");
} }
void IR_USER::Disconnect(Kernel::HLERequestContext& ctx) { void IR_USER::Disconnect(Kernel::HLERequestContext& ctx) {
@ -318,7 +318,7 @@ void IR_USER::Disconnect(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb(ctx, 0x09, 1, 0); IPC::RequestBuilder rb(ctx, 0x09, 1, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_INFO(Service_IR, "called"); NGLOG_INFO(Service_IR, "called");
} }
void IR_USER::GetConnectionStatusEvent(Kernel::HLERequestContext& ctx) { void IR_USER::GetConnectionStatusEvent(Kernel::HLERequestContext& ctx) {
@ -327,7 +327,7 @@ void IR_USER::GetConnectionStatusEvent(Kernel::HLERequestContext& ctx) {
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
rb.PushCopyObjects(conn_status_event); rb.PushCopyObjects(conn_status_event);
LOG_INFO(Service_IR, "called"); NGLOG_INFO(Service_IR, "called");
} }
void IR_USER::FinalizeIrNop(Kernel::HLERequestContext& ctx) { void IR_USER::FinalizeIrNop(Kernel::HLERequestContext& ctx) {
@ -342,7 +342,7 @@ void IR_USER::FinalizeIrNop(Kernel::HLERequestContext& ctx) {
IPC::RequestBuilder rb(ctx, 0x02, 1, 0); IPC::RequestBuilder rb(ctx, 0x02, 1, 0);
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
LOG_INFO(Service_IR, "called"); NGLOG_INFO(Service_IR, "called");
} }
void IR_USER::SendIrNop(Kernel::HLERequestContext& ctx) { void IR_USER::SendIrNop(Kernel::HLERequestContext& ctx) {
@ -357,12 +357,12 @@ void IR_USER::SendIrNop(Kernel::HLERequestContext& ctx) {
send_event->Signal(); send_event->Signal();
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} else { } else {
LOG_ERROR(Service_IR, "not connected"); NGLOG_ERROR(Service_IR, "not connected");
rb.Push(ResultCode(static_cast<ErrorDescription>(13), ErrorModule::IR, rb.Push(ResultCode(static_cast<ErrorDescription>(13), ErrorModule::IR,
ErrorSummary::InvalidState, ErrorLevel::Status)); ErrorSummary::InvalidState, ErrorLevel::Status));
} }
LOG_TRACE(Service_IR, "called, data=%s", Common::ArrayToString(buffer.data(), size).c_str()); NGLOG_TRACE(Service_IR, "called, data={}", Common::ArrayToString(buffer.data(), size));
} }
void IR_USER::ReleaseReceivedData(Kernel::HLERequestContext& ctx) { void IR_USER::ReleaseReceivedData(Kernel::HLERequestContext& ctx) {
@ -374,12 +374,12 @@ void IR_USER::ReleaseReceivedData(Kernel::HLERequestContext& ctx) {
if (receive_buffer->Release(count)) { if (receive_buffer->Release(count)) {
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} else { } else {
LOG_ERROR(Service_IR, "failed to release %u packets", count); NGLOG_ERROR(Service_IR, "failed to release {} packets", count);
rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::IR, ErrorSummary::NotFound, rb.Push(ResultCode(ErrorDescription::NoData, ErrorModule::IR, ErrorSummary::NotFound,
ErrorLevel::Status)); ErrorLevel::Status));
} }
LOG_TRACE(Service_IR, "called, count=%u", count); NGLOG_TRACE(Service_IR, "called, count={}", count);
} }
IR_USER::IR_USER() : ServiceFramework("ir:USER", 1) { IR_USER::IR_USER() : ServiceFramework("ir:USER", 1) {