1
0
Fork 0

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
1 changed files with 8 additions and 10 deletions

View File

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