summaryrefslogtreecommitdiff
path: root/src/log.cpp
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-03-07 17:55:15 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-03-07 18:03:03 +0800
commit3972c5f76483bf5f64bcf19685ee391c4d6b1a9b (patch)
treedb258338afafa632d3f51baed3665c3c1f1dbb05 /src/log.cpp
parentc37bd3e34f5840773949bb55848cda3af6688d20 (diff)
refactor(format,log): better/simpler way to do them
Diffstat (limited to 'src/log.cpp')
-rw-r--r--src/log.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/log.cpp b/src/log.cpp
deleted file mode 100644
index 8cd3ded..0000000
--- a/src/log.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "log.hpp"
-
-void log(eLogLevel level, std::string str) {
- // Use CFormatter for the prefix part
- std::string prefixed;
- switch (level) {
- case INFO:
- prefixed = CFormatter::fmt<const std::string &>(eFormatType::STANDARD, "{}", str);
- str = useColors ? "\033[1;32m" + prefixed + "\033[0m" : prefixed; // green
- break;
- case WARN:
- prefixed = CFormatter::fmt<const std::string &>(eFormatType::SYSTEM, "{}", str);
- str = useColors ? "\033[1;33m" + prefixed + "\033[0m" : prefixed; // yellow
- break;
- case ERROR:
- prefixed = CFormatter::fmt<const std::string &>(eFormatType::ERROR, "{}", str);
- str = useColors ? "\033[1;31m" + prefixed + "\033[0m" : prefixed; // red
- break;
- case FATAL:
- prefixed = CFormatter::fmt<const std::string &>(eFormatType::ERROR, "{}", str);
- str = useColors ? "\033[1;35m" + prefixed + "\033[0m" : prefixed; // magenta
- break;
- }
-
- std::println("{}", str); // Changed to print since we're managing the newline ourselves
-}