Merge pull request #3860 from NarcolepticK/service-migrate-logging

service/service: Migrate logging macros
This commit is contained in:
Weiyi Wang 2018-06-22 11:47:49 +03:00 committed by GitHub
commit c3466f38d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,16 +94,15 @@ void Interface::HandleSyncRequest(SharedPtr<ServerSession> server_session) {
std::string function_name = (itr == m_functions.end()) std::string function_name = (itr == m_functions.end())
? Common::StringFromFormat("0x%08X", cmd_buff[0]) ? Common::StringFromFormat("0x%08X", cmd_buff[0])
: itr->second.name; : itr->second.name;
LOG_ERROR( NGLOG_ERROR(Service, "unknown / unimplemented {}",
Service, "unknown / unimplemented %s", MakeFunctionString(function_name.c_str(), GetPortName().c_str(), cmd_buff));
MakeFunctionString(function_name.c_str(), GetPortName().c_str(), cmd_buff).c_str());
// TODO(bunnei): Hack - ignore error // TODO(bunnei): Hack - ignore error
cmd_buff[1] = 0; cmd_buff[1] = 0;
return; return;
} }
LOG_TRACE(Service, "%s", NGLOG_TRACE(Service, "{}",
MakeFunctionString(itr->second.name, GetPortName().c_str(), cmd_buff).c_str()); MakeFunctionString(itr->second.name, GetPortName().c_str(), cmd_buff));
itr->second.func(this); itr->second.func(this);
} }
@ -160,7 +159,7 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(u32* cmd_buf, const Funct
} }
buf.push_back('}'); buf.push_back('}');
LOG_ERROR(Service, "unknown / unimplemented %s", fmt::to_string(buf).c_str()); NGLOG_ERROR(Service, "unknown / unimplemented {}", fmt::to_string(buf));
// TODO(bunnei): Hack - ignore error // TODO(bunnei): Hack - ignore error
cmd_buf[1] = 0; cmd_buf[1] = 0;
} }
@ -181,8 +180,7 @@ void ServiceFrameworkBase::HandleSyncRequest(SharedPtr<ServerSession> server_ses
context.PopulateFromIncomingCommandBuffer(cmd_buf, *Kernel::g_current_process, context.PopulateFromIncomingCommandBuffer(cmd_buf, *Kernel::g_current_process,
Kernel::g_handle_table); Kernel::g_handle_table);
LOG_TRACE(Service, "%s", NGLOG_TRACE(Service, "{}", MakeFunctionString(info->name, GetServiceName().c_str(), cmd_buf));
MakeFunctionString(info->name, GetServiceName().c_str(), cmd_buf).c_str());
handler_invoker(this, info->handler_callback, context); handler_invoker(this, info->handler_callback, context);
auto thread = Kernel::GetCurrentThread(); auto thread = Kernel::GetCurrentThread();
@ -267,7 +265,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
AddService(new SSL::SSL_C); AddService(new SSL::SSL_C);
Y2R::InstallInterfaces(*sm); Y2R::InstallInterfaces(*sm);
LOG_DEBUG(Service, "initialized OK"); NGLOG_DEBUG(Service, "initialized OK");
} }
/// Shutdown ServiceManager /// Shutdown ServiceManager
@ -278,6 +276,6 @@ void Shutdown() {
FS::ArchiveShutdown(); FS::ArchiveShutdown();
g_kernel_named_ports.clear(); g_kernel_named_ports.clear();
LOG_DEBUG(Service, "shutdown OK"); NGLOG_DEBUG(Service, "shutdown OK");
} }
} // namespace Service } // namespace Service