Files
palladium/source/common.cpp
TobiD7 a86c13b9a3 Refactor PD::Li Pools system, Upgrade PD::Pool and add better logging
- Add ResetFast to Pool using c++20 concept
- Add Put function to Pool
- Use Pool Index instead of pointers in Command
- Add accessor to Li Pools to prevent wrong command usage
- Add Command Formatter
- Use ResetFast for all Pools
- Add Reset func to Li::Vertex (for ResetFast)
- Add Pool Expandor and Put funcs to Lithium pools
- Add getters for GfxDriverBase to PD::Li Pools
2026-03-21 13:35:16 +01:00

30 lines
785 B
C++

#include <iostream>
#include <pd/common.hpp>
namespace PD {
constexpr const char* pColorNo = "\033[0m";
constexpr const char* pColorYellow = "\033[33m";
constexpr const char* pColorRed = "\033[31m";
static LogLevel pFilter = LogLevel::Info;
PD_API void Log(const std::string& txt, LogLevel lvl) {
if ((int)lvl < (int)pFilter) return;
const char* clr = pColorNo;
const char* plvl = "INFO";
switch (lvl) {
case PD::LogLevel::Info:
clr = pColorNo;
plvl = "INFO";
break;
case PD::LogLevel::Warning:
clr = pColorYellow;
plvl = "WARNING";
break;
case PD::LogLevel::Error:
clr = pColorRed;
plvl = "ERROR";
break;
}
std::cout << clr << "[PD][" << plvl << "] " << txt << pColorNo << std::endl;
}
} // namespace PD