mirror of
https://github.com/PashaBibko/LX.git
synced 2026-04-03 17:39:02 +00:00
Improved logging capabilities
This commit is contained in:
@@ -11,23 +11,23 @@ namespace LX::AST
|
||||
|
||||
void NumberLiteral::Log(unsigned depth)
|
||||
{
|
||||
Log::out(std::string(depth, '\t'), "Number: ", m_Number);
|
||||
Log::out<Log::Priority::HIGH>(std::string(depth, '\t'), "Number: ", m_Number);
|
||||
}
|
||||
|
||||
void Operation::Log(unsigned depth)
|
||||
{
|
||||
Log::out(std::string(depth, '\t'), "Operation {", ToString(m_Operand), "}:");
|
||||
Log::out<Log::Priority::HIGH>(std::string(depth, '\t'), "Operation {", ToString(m_Operand), "}:");
|
||||
|
||||
Log::out(std::string(depth + 1, '\t'), "LHS:");
|
||||
Log::out<Log::Priority::HIGH>(std::string(depth + 1, '\t'), "LHS:");
|
||||
m_Lhs->Log(depth + 2);
|
||||
|
||||
Log::out(std::string(depth + 1, '\t'), "RHS:");
|
||||
Log::out<Log::Priority::HIGH>(std::string(depth + 1, '\t'), "RHS:");
|
||||
m_Rhs->Log(depth + 2);
|
||||
}
|
||||
|
||||
void ReturnStatement::Log(unsigned depth)
|
||||
{
|
||||
Log::out<Log::Format::NONE>(std::string(depth, '\t'), "Return");
|
||||
Log::out<Log::Priority::HIGH, Log::Format::NONE>(std::string(depth, '\t'), "Return");
|
||||
|
||||
if (m_Val != nullptr)
|
||||
{
|
||||
@@ -37,26 +37,26 @@ namespace LX::AST
|
||||
|
||||
else
|
||||
{
|
||||
Log::out<Log::Format::NONE>('\n');
|
||||
Log::out<Log::Priority::HIGH, Log::Format::NONE>('\n');
|
||||
}
|
||||
}
|
||||
|
||||
void VariableDeclaration::Log(unsigned depth)
|
||||
{
|
||||
Log::out(std::string(depth, '\t'), "Variable declaration: ", m_Name);
|
||||
Log::out<Log::Priority::HIGH>(std::string(depth, '\t'), "Variable declaration: ", m_Name);
|
||||
}
|
||||
|
||||
void VariableAssignment::Log(unsigned depth)
|
||||
{
|
||||
Log::out(std::string(depth, '\t'), "Variable assignment:");
|
||||
Log::out<Log::Priority::HIGH>(std::string(depth, '\t'), "Variable assignment:");
|
||||
|
||||
Log::out(std::string(depth + 1, '\t'), "To: ", m_Name);
|
||||
Log::out(std::string(depth + 1, '\t'), "Value:");
|
||||
Log::out<Log::Priority::HIGH>(std::string(depth + 1, '\t'), "To: ", m_Name);
|
||||
Log::out<Log::Priority::HIGH>(std::string(depth + 1, '\t'), "Value:");
|
||||
m_Value->Log(depth + 2);
|
||||
}
|
||||
|
||||
void VariableAccess::Log(unsigned depth)
|
||||
{
|
||||
Log::out(std::string(depth, '\t'), "Variable: ", m_Name);
|
||||
Log::out<Log::Priority::HIGH>(std::string(depth, '\t'), "Variable: ", m_Name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user