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
This commit is contained in:
@@ -1,6 +1,30 @@
|
||||
#include <iostream>
|
||||
#include <pd/common.hpp>
|
||||
|
||||
PD_API void PD::Log(const std::string& txt) {
|
||||
std::cout << "[PD] " << txt << std::endl;
|
||||
}
|
||||
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
|
||||
Reference in New Issue
Block a user