summaryrefslogtreecommitdiffstats
path: root/src/common/log_manager.cpp
diff options
context:
space:
mode:
authorbunnei <ericbunnie@gmail.com>2014-05-30 05:03:03 +0200
committerbunnei <ericbunnie@gmail.com>2014-05-30 05:03:03 +0200
commit6fc62f8c93bd81f6207fcbdfe332b4e56c2aa2be (patch)
treed6a66ca0fdd3f6e2ff66cf1f88283107d525c0c7 /src/common/log_manager.cpp
parentcore: changed time delay before kernel reschedule to "approximate" a screen refresh (diff)
downloadyuzu-6fc62f8c93bd81f6207fcbdfe332b4e56c2aa2be.tar
yuzu-6fc62f8c93bd81f6207fcbdfe332b4e56c2aa2be.tar.gz
yuzu-6fc62f8c93bd81f6207fcbdfe332b4e56c2aa2be.tar.bz2
yuzu-6fc62f8c93bd81f6207fcbdfe332b4e56c2aa2be.tar.lz
yuzu-6fc62f8c93bd81f6207fcbdfe332b4e56c2aa2be.tar.xz
yuzu-6fc62f8c93bd81f6207fcbdfe332b4e56c2aa2be.tar.zst
yuzu-6fc62f8c93bd81f6207fcbdfe332b4e56c2aa2be.zip
Diffstat (limited to 'src/common/log_manager.cpp')
-rw-r--r--src/common/log_manager.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/common/log_manager.cpp b/src/common/log_manager.cpp
index 146472888..d026fca56 100644
--- a/src/common/log_manager.cpp
+++ b/src/common/log_manager.cpp
@@ -10,14 +10,16 @@
#include "common/thread.h"
#include "common/file_util.h"
-void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
- const char *file, int line, const char* fmt, ...)
+void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char* file, int line,
+ const char* function, const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
- if (LogManager::GetInstance())
+
+ if (LogManager::GetInstance()) {
LogManager::GetInstance()->Log(level, type,
- file, line, fmt, args);
+ file, line, function, fmt, args);
+ }
va_end(args);
}
@@ -88,6 +90,8 @@ LogManager::LogManager()
m_Log[i]->AddListener(m_debuggerLog);
#endif
}
+
+ m_consoleLog->Open();
}
LogManager::~LogManager()
@@ -107,8 +111,8 @@ LogManager::~LogManager()
delete m_debuggerLog;
}
-void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
- const char *file, int line, const char *format, va_list args)
+void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char* file,
+ int line, const char* function, const char *fmt, va_list args)
{
char temp[MAX_MSGLEN];
char msg[MAX_MSGLEN * 2];
@@ -117,17 +121,15 @@ void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
if (!log->IsEnabled() || level > log->GetLevel() || ! log->HasListeners())
return;
- CharArrayFromFormatV(temp, MAX_MSGLEN, format, args);
+ CharArrayFromFormatV(temp, MAX_MSGLEN, fmt, 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);
+ static const char level_to_char[7] = "ONEWID";
+ sprintf(msg, "%s %s:%u %c[%s] %s: %s\n", Common::Timer::GetTimeFormatted().c_str(), file, line,
+ level_to_char[(int)level], log->GetShortName(), function, temp);
+
#ifdef ANDROID
Host_SysMessage(msg);
#endif
- printf(msg); // TODO(ShizZy): RemoveMe when I no longer need this
log->Trigger(level, msg);
}