diff options
| author | nakeee <nakeee@gmail.com> | 2010-01-03 08:48:48 +0000 |
|---|---|---|
| committer | nakeee <nakeee@gmail.com> | 2010-01-03 08:48:48 +0000 |
| commit | ad594abe6963a79f91f0116accd98feed0816782 (patch) | |
| tree | f8ca515a0ed1400ac2d2f610b3cbd70ec4e60295 /Source/Core/Common/Src/LogManager.cpp | |
| parent | ded7a2921dea239dda91de3bb9897b3fb8a68afb (diff) | |
Adding line and file name to the log.
This makes the log line a bit too long in my taste so if anyone got
an idea of how to make it look nicer i.e making it optional or adding it only to errors/warnings
do share
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4776 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/LogManager.cpp')
| -rw-r--r-- | Source/Core/Common/Src/LogManager.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/Core/Common/Src/LogManager.cpp b/Source/Core/Common/Src/LogManager.cpp index 8af3d103c6..199a0cf4f0 100644 --- a/Source/Core/Common/Src/LogManager.cpp +++ b/Source/Core/Common/Src/LogManager.cpp @@ -17,12 +17,12 @@ #include "LogManager.h" #include "Timer.h" - -void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char* fmt, ...) +void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, + const char *file, int line, const char* fmt, ...) { va_list args; va_start(args, fmt); - LogManager::GetInstance()->Log(level, type, fmt, args); + LogManager::GetInstance()->Log(level, type, file, line, fmt, args); va_end(args); } @@ -95,7 +95,8 @@ LogManager::~LogManager() { } void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, - const char *format, va_list args) { + const char *file, int line, const char *format, + va_list args) { char temp[MAX_MSGLEN]; char msg[MAX_MSGLEN + 512]; @@ -107,11 +108,10 @@ 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 %c[%s]: %s\n", + sprintf(msg, "%s %s:%u %c[%s]: %s\n", Common::Timer::GetTimeFormatted().c_str(), - level_to_char[(int)level], - log->getShortName(), - temp); + file, line, level_to_char[(int)level], + log->getShortName(), temp); logMutex.Enter(); log->trigger(level, msg); |
