15 #if KAPENGINE_THREAD_ACTIVE
16 #if KAPENGINE_BETA_ACTIVE
21 #include "KapEngineSettings.hpp"
22 #include "Profiler/KapProfiler.hpp"
31 static void log(std::string _msg, std::string prefix =
"");
33 static void log(
char const* _msg, std::string prefix =
"") {
34 PROFILER_FUNC_START();
35 log(std::string(_msg), prefix);
39 static void log(
const char *_msg,
const char *fileName,
int const line) {
40 PROFILER_FUNC_START();
41 log(std::string(_msg), fileName, line);
45 static void log(std::string
const& _msg,
const char *fileName,
int const line) {
46 PROFILER_FUNC_START();
47 log(std::string(_msg),
"[" + colorGreen() + std::string(fileName) + colorNone() +
" " + colorBlue() +
"l. " + std::to_string(line) + colorNone() +
"]");
54 static void warning(std::string _msg, std::string prefix =
"");
56 static void warning(
char const* _msg, std::string prefix =
"") {
57 PROFILER_FUNC_START();
58 warning(std::string(_msg), prefix);
62 static void warning(
const char *_msg,
const char *fileName,
int const line) {
63 PROFILER_FUNC_START();
64 warning(std::string(_msg), fileName, line);
68 static void warning(std::string
const& _msg,
const char *fileName,
int const line) {
69 PROFILER_FUNC_START();
70 warning(std::string(_msg),
"[" + colorYellow() + std::string(fileName) + colorNone() +
" " + colorBlue() +
"l. " + std::to_string(line) + colorNone() +
"]");
76 static void error(std::string _msg, std::string prefix =
"");
78 static void error(
char const* _msg, std::string prefix =
"") {
79 PROFILER_FUNC_START();
80 error(std::string(_msg), prefix);
84 static void error(
const char *_msg,
const char *fileName,
int const line) {
85 PROFILER_FUNC_START();
86 error(std::string(_msg), fileName, line);
90 static void error(std::string
const& _msg,
const char *fileName,
int const line) {
91 PROFILER_FUNC_START();
92 error(std::string(_msg),
"[" + colorRed() + std::string(fileName) + colorNone() +
" " + colorBlue() +
"l. " + std::to_string(line) + colorNone() +
"]");
96 static std::string colorNone() {
97 PROFILER_FUNC_START();
106 static std::string colorRed() {
107 PROFILER_FUNC_START();
116 static std::string colorYellow() {
117 PROFILER_FUNC_START();
126 static std::string colorWhite() {
127 PROFILER_FUNC_START();
136 static std::string colorBlue() {
137 PROFILER_FUNC_START();
146 static std::string colorBlack() {
147 PROFILER_FUNC_START();
156 static std::string colorGreen() {
157 PROFILER_FUNC_START();
166 static std::string colorMagenta() {
167 PROFILER_FUNC_START();
176 static std::string colorCyan() {
177 PROFILER_FUNC_START();
186 static std::string colorBackgroundDefault() {
187 PROFILER_FUNC_START();
196 static std::string colorBackgroundRed() {
197 PROFILER_FUNC_START();
206 static std::string colorBackgroundYellow() {
207 PROFILER_FUNC_START();
216 static std::string colorBackgroundWhite() {
217 PROFILER_FUNC_START();
226 static std::string colorBackgroundBlue() {
227 PROFILER_FUNC_START();
236 static std::string colorBackgroundBlack() {
237 PROFILER_FUNC_START();
246 static std::string colorBackgroundGreen() {
247 PROFILER_FUNC_START();
256 static std::string colorBackgroundMagenta() {
257 PROFILER_FUNC_START();
266 static std::string colorBackgroundCyan() {
267 PROFILER_FUNC_START();
276 static std::string boldStyle() {
277 PROFILER_FUNC_START();
286 #if KAPENGINE_THREAD_ACTIVE
287 #if KAPENGINE_BETA_ACTIVE
288 static std::mutex logMutex;
295 static std::string __getCDate() {
296 PROFILER_FUNC_START();
298 time_t now = std::time(0);
301 char* dt = std::ctime(&now);
302 std::string _str(dt);