Logging system rework

* use one central unified log with channels/priorities ad-hoc listener registration and de-registration
* disable buffering by default
* add multi-threaded ringbuffer implementation
* use buffered listener for the gui (using the ringbuffer)
This commit is contained in:
Peter Tissen 2014-06-17 17:44:03 +02:00 committed by Bigpet
parent 394b698e92
commit 21da317453
165 changed files with 1731 additions and 1519 deletions

View file

@ -1,5 +1,5 @@
#include "stdafx.h"
#include "Emu/ConLog.h"
#include "Utilities/Log.h"
#include "Emu/Memory/Memory.h"
#include "Emu/System.h"
#include "Emu/Cell/PPUThread.h"
@ -54,14 +54,14 @@ void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base)
k--;
if (can_skip) // cannot define this behaviour properly
{
ConLog.Warning("StaticAnalyse(): can_skip = %d (unchanged)", can_skip);
LOGF_WARNING(LOADER, "StaticAnalyse(): can_skip = %d (unchanged)", can_skip);
}
}
else
{
if (can_skip) // cannot define this behaviour properly
{
ConLog.Warning("StaticAnalyse(): can_skip = %d (set to 0)", can_skip);
LOGF_WARNING(LOADER, "StaticAnalyse(): can_skip = %d (set to 0)", can_skip);
can_skip = 0;
}
}
@ -85,7 +85,7 @@ void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base)
}
if (found)
{
ConLog.Write("Function '%s' hooked (addr=0x%x)", m_static_funcs_list[j]->name, i * 4 + base);
LOGF_NOTICE(LOADER, "Function '%s' hooked (addr=0x%x)", m_static_funcs_list[j]->name, i * 4 + base);
m_static_funcs_list[j]->found++;
data[i+0] = re32(0x39600000 | j); // li r11, j
data[i+1] = se32(0x44000003); // sc 3
@ -129,7 +129,7 @@ void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base)
if (count == 0)
{
res |= GSR_MISSING;
ConLog.Error("Function '%s' not found", m_static_funcs_list[j]->name);
LOGF_ERROR(LOADER, "Function '%s' not found", m_static_funcs_list[j]->name);
}
else if (count > 1)
{
@ -146,7 +146,7 @@ void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base)
if (m_static_funcs_list[k]->found)
{
res |= GSR_EXCESS;
ConLog.Error("Function '%s' hooked twice", m_static_funcs_list[j]->name);
LOGF_ERROR(LOADER, "Function '%s' hooked twice", m_static_funcs_list[j]->name);
}
}
}
@ -154,7 +154,7 @@ void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base)
else
{
res |= GSR_EXCESS;
ConLog.Error("Function '%s' hooked twice", m_static_funcs_list[j]->name);
LOGF_ERROR(LOADER, "Function '%s' hooked twice", m_static_funcs_list[j]->name);
}
}
@ -170,11 +170,11 @@ void StaticFuncManager::StaticAnalyse(void* ptr, u32 size, u32 base)
if (res == GSR_SUCCESS)
{
ConLog.Success("Function group [%s] successfully hooked", std::string(name, 9).c_str());
LOGF_SUCCESS(LOADER, "Function group [%s] successfully hooked", std::string(name, 9).c_str());
}
else
{
ConLog.Error("Function group [%s] failed:%s%s", std::string(name, 9).c_str(),
LOGF_ERROR(LOADER, "Function group [%s] failed:%s%s", std::string(name, 9).c_str(),
(res & GSR_MISSING ? " missing;" : ""),
(res & GSR_EXCESS ? " excess;" : ""));
}
@ -190,7 +190,7 @@ void StaticFuncManager::StaticExecute(u32 code)
}
else
{
ConLog.Error("StaticExecute(%d): unknown function or illegal opcode", code);
LOGF_ERROR(LOADER, "StaticExecute(%d): unknown function or illegal opcode", code);
}
}