Variadic templates for module logs

Two new module log types: Todo() and Notice()
This commit is contained in:
Nekotekina 2014-07-21 18:42:43 +04:00
parent da8194d659
commit 640de81571
29 changed files with 233 additions and 235 deletions

View file

@ -158,60 +158,6 @@ void Module::SetName(const std::string& name)
m_name = name;
}
void Module::Log(const u32 id, std::string fmt, ...)
{
if(Ini.HLELogging.GetValue())
{
va_list list;
va_start(list, fmt);
LOG_NOTICE(HLE, GetName() + fmt::Format("[%d]: ", id) + fmt::FormatV(fmt, list));
va_end(list);
}
}
void Module::Log(std::string fmt, ...)
{
if(Ini.HLELogging.GetValue())
{
va_list list;
va_start(list, fmt);
LOG_NOTICE(HLE, GetName() + ": " + fmt::FormatV(fmt, list));
va_end(list);
}
}
void Module::Warning(const u32 id, std::string fmt, ...)
{
va_list list;
va_start(list, fmt);
LOG_WARNING(HLE, GetName() + fmt::Format("[%d] warning: ", id) + fmt::FormatV(fmt, list));
va_end(list);
}
void Module::Warning(std::string fmt, ...)
{
va_list list;
va_start(list, fmt);
LOG_WARNING(HLE, GetName() + " warning: " + fmt::FormatV(fmt, list));
va_end(list);
}
void Module::Error(const u32 id, std::string fmt, ...)
{
va_list list;
va_start(list, fmt);
LOG_ERROR(HLE, GetName() + fmt::Format("[%d] error: ", id) + fmt::FormatV(fmt, list));
va_end(list);
}
void Module::Error(std::string fmt, ...)
{
va_list list;
va_start(list, fmt);
LOG_ERROR(HLE, GetName() + " error: " + fmt::FormatV(fmt, list));
va_end(list);
}
bool Module::CheckID(u32 id) const
{
return Emu.GetIdManager().CheckID(id) && Emu.GetIdManager().GetID(id).m_name == GetName();