Colourful logs

This commit is contained in:
DcruBro
2025-11-25 00:36:29 +01:00
parent de3ec98363
commit f776f1fdd1
4 changed files with 19 additions and 22 deletions

View File

@@ -6,15 +6,23 @@
namespace ColumnLynx::Utils {
void log(const std::string &msg) {
std::cout << "[LOG] " << msg << std::endl;
std::cout << "\033[0m[LOG] " << msg << std::endl;
}
void warn(const std::string &msg) {
std::cerr << "[WARN] " << msg << std::endl;
std::cerr << "\033[33m[WARN] " << msg << "\033[0m" << std::endl;
}
void error(const std::string &msg) {
std::cerr << "[ERROR] " << msg << std::endl;
std::cerr << "\033[31m[ERROR] " << msg << "\033[0m" << std::endl;
}
void debug(const std::string &msg) {
#if DEBUG || _DEBUG
std::cerr << "\033[95m[DEBUG] " << msg << "\033[0m" << std::endl;
#else
return;
#endif
}
std::string getHostname() {