|
|
@@ -4,6 +4,7 @@ import Core.TerminalConstants;
|
|
|
import Core.Meta;
|
|
|
import Core.ToString;
|
|
|
import Core.Std;
|
|
|
+import Core.StringJoin;
|
|
|
|
|
|
#define SOURCE const std::source_location& sl = std::source_location::current()
|
|
|
|
|
|
@@ -56,37 +57,35 @@ export namespace Core {
|
|
|
template<typename... Args>
|
|
|
void logError(const FormatLocation& format, Args&&... args) noexcept {
|
|
|
if constexpr(LOG_LEVEL >= 1) {
|
|
|
- String<32> s;
|
|
|
- s.addFormat("{}[ERROR] ", Terminal::FG_RED);
|
|
|
- log(LogLevel::ERROR, s, format, forward<Args>(args)...);
|
|
|
+ log(LogLevel::ERROR, mergeStrings(Terminal::FG_RED, "[ERROR] "),
|
|
|
+ format, forward<Args>(args)...);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
template<typename... Args>
|
|
|
void logWarning(const FormatLocation& format, Args&&... args) noexcept {
|
|
|
if constexpr(LOG_LEVEL >= 2) {
|
|
|
- String<32> s;
|
|
|
- s.addFormat("{}[WARNING] ", Terminal::FG_BRIGHT_YELLOW);
|
|
|
- log(LogLevel::WARNING, s, format, forward<Args>(args)...);
|
|
|
+ log(LogLevel::WARNING,
|
|
|
+ mergeStrings(Terminal::FG_BRIGHT_YELLOW, "[WARNING] "), format,
|
|
|
+ forward<Args>(args)...);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
template<typename... Args>
|
|
|
void logInfo(const FormatLocation& format, Args&&... args) noexcept {
|
|
|
if constexpr(LOG_LEVEL >= 3) {
|
|
|
- String<32> s;
|
|
|
- s.addFormat("{}[INFO] ", Terminal::BOLD);
|
|
|
- log(LogLevel::INFO, s, format, forward<Args>(args)...);
|
|
|
+ log(LogLevel::INFO, mergeStrings(Terminal::BOLD, "[INFO] "), format,
|
|
|
+ forward<Args>(args)...);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
template<typename... Args>
|
|
|
void logDebug(const FormatLocation& format, Args&&... args) noexcept {
|
|
|
if constexpr(LOG_LEVEL >= 4) {
|
|
|
- String<32> s;
|
|
|
- s.addFormat(
|
|
|
- "{}{}[DEBUG] ", Terminal::BOLD, Terminal::FG_BRIGHT_BLACK);
|
|
|
- log(LogLevel::DEBUG, s, format, forward<Args>(args)...);
|
|
|
+ log(LogLevel::DEBUG,
|
|
|
+ mergeStrings(
|
|
|
+ Terminal::FG_BRIGHT_BLACK, Terminal::BOLD, "[DEBUG] "),
|
|
|
+ format, forward<Args>(args)...);
|
|
|
}
|
|
|
}
|
|
|
}
|