mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-18 08:11:40 +00:00
Some tidy up of sprintf to StringFromFormat
This commit is contained in:
parent
64e01ec763
commit
ebff7974c3
13 changed files with 64 additions and 111 deletions
|
@ -114,7 +114,6 @@ void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
|
|||
const char *file, int line, const char *format, va_list args)
|
||||
{
|
||||
char temp[MAX_MSGLEN];
|
||||
char msg[MAX_MSGLEN * 2];
|
||||
LogContainer *log = m_Log[type];
|
||||
|
||||
if (!log->IsEnabled() || level > log->GetLevel() || ! log->HasListeners())
|
||||
|
@ -122,15 +121,15 @@ void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
|
|||
|
||||
CharArrayFromFormatV(temp, MAX_MSGLEN, format, args);
|
||||
|
||||
static const char level_to_char[7] = "-NEWID";
|
||||
sprintf(msg, "%s %s:%u %c[%s]: %s\n",
|
||||
Common::Timer::GetTimeFormatted().c_str(),
|
||||
file, line, level_to_char[(int)level],
|
||||
log->GetShortName(), temp);
|
||||
std::string msg = StringFromFormat("%s %s:%u %c[%s]: %s\n",
|
||||
Common::Timer::GetTimeFormatted().c_str(),
|
||||
file, line,
|
||||
LogTypes::LOG_LEVEL_TO_CHAR[(int)level],
|
||||
log->GetShortName(), temp);
|
||||
#ifdef ANDROID
|
||||
Host_SysMessage(msg);
|
||||
Host_SysMessage(msg.c_str());
|
||||
#endif
|
||||
log->Trigger(level, msg);
|
||||
log->Trigger(level, msg.c_str());
|
||||
}
|
||||
|
||||
void LogManager::Init()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue