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"
@ -49,7 +49,7 @@ std::string GLVertexDecompilerThread::GetDST(bool isSca)
default:
if (d3.dst > 15)
ConLog.Error("dst index out of range: %u", d3.dst);
LOGF_ERROR(RSX, "dst index out of range: %u", d3.dst);
ret += m_parr.AddParam(PARAM_NONE, "vec4", std::string("dst_reg") + std::to_string(d3.dst), d3.dst == 0 ? "vec4(0.0f, 0.0f, 0.0f, 1.0f)" : "vec4(0.0)");
break;
}
@ -83,7 +83,7 @@ std::string GLVertexDecompilerThread::GetSRC(const u32 n)
}
else
{
ConLog.Error("Bad input src num: %d", fmt::by_value(d1.input_src));
LOGF_ERROR(RSX, "Bad input src num: %d", fmt::by_value(d1.input_src));
ret += m_parr.AddParam(PARAM_IN, "vec4", "in_unk", d1.input_src);
}
break;
@ -93,7 +93,7 @@ std::string GLVertexDecompilerThread::GetSRC(const u32 n)
break;
default:
ConLog.Error("Bad src%u reg type: %d", n, fmt::by_value(src[n].reg_type));
LOGF_ERROR(RSX, "Bad src%u reg type: %d", n, fmt::by_value(src[n].reg_type));
Emu.Pause();
break;
}
@ -510,7 +510,7 @@ void GLVertexDecompilerThread::Task()
default:
m_body.push_back(fmt::Format("//Unknown vp sca_opcode 0x%x", fmt::by_value(d1.sca_opcode)));
ConLog.Error("Unknown vp sca_opcode 0x%x", fmt::by_value(d1.sca_opcode));
LOGF_ERROR(RSX, "Unknown vp sca_opcode 0x%x", fmt::by_value(d1.sca_opcode));
Emu.Pause();
break;
}
@ -543,7 +543,7 @@ void GLVertexDecompilerThread::Task()
default:
m_body.push_back(fmt::Format("//Unknown vp opcode 0x%x", fmt::by_value(d1.vec_opcode)));
ConLog.Error("Unknown vp opcode 0x%x", fmt::by_value(d1.vec_opcode));
LOGF_ERROR(RSX, "Unknown vp opcode 0x%x", fmt::by_value(d1.vec_opcode));
Emu.Pause();
break;
}
@ -553,7 +553,7 @@ void GLVertexDecompilerThread::Task()
m_instr_count++;
if(i < m_data.size())
ConLog.Error("Program end before buffer end.");
LOG_ERROR(RSX, "Program end before buffer end.");
break;
}
@ -647,14 +647,14 @@ void GLVertexProgram::Compile()
GLsizei len;
memset(buf, 0, r+1);
glGetShaderInfoLog(id, r, &len, buf);
ConLog.Error("Failed to compile vertex shader: %s", buf);
LOGF_ERROR(RSX, "Failed to compile vertex shader: %s", buf);
delete[] buf;
}
ConLog.Write(shader);
LOG_NOTICE(RSX, shader);
Emu.Pause();
}
//else ConLog.Write("Vertex shader compiled successfully!");
//else LOGF_WARNING(RSX, "Vertex shader compiled successfully!");
}
@ -667,7 +667,7 @@ void GLVertexProgram::Delete()
{
if (Emu.IsStopped())
{
ConLog.Warning("GLVertexProgram::Delete(): glDeleteShader(%d) avoided", id);
LOGF_WARNING(RSX, "GLVertexProgram::Delete(): glDeleteShader(%d) avoided", id);
}
else
{