|
|
@ -137,34 +137,67 @@ namespace Inferno { |
|
|
|
// -----------------------------------------
|
|
|
|
// -----------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
DebugLogStream dbg(); |
|
|
|
DebugLogStream dbg(); |
|
|
|
|
|
|
|
DebugLogStream info(); |
|
|
|
|
|
|
|
DebugLogStream warn(); |
|
|
|
|
|
|
|
DebugLogStream danger(); |
|
|
|
|
|
|
|
DebugLogStream success(); |
|
|
|
|
|
|
|
DebugLogStream comment(); |
|
|
|
|
|
|
|
|
|
|
|
DebugLogStream dbg(bool newline); |
|
|
|
DebugLogStream dbg(bool newline); |
|
|
|
DebugLogStream dbg(Log type); |
|
|
|
DebugLogStream info(bool newline); |
|
|
|
DebugLogStream dbg(Log type, bool newline); |
|
|
|
DebugLogStream warn(bool newline); |
|
|
|
|
|
|
|
DebugLogStream danger(bool newline); |
|
|
|
|
|
|
|
DebugLogStream success(bool newline); |
|
|
|
|
|
|
|
DebugLogStream comment(bool newline); |
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------
|
|
|
|
// -----------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
void dbgln(Log type, bool newline); |
|
|
|
template<typename... P> void dbgln(const char* format, P&&... parameters) { return dbgln(Log::None, true, format, std::forward<P>(parameters)...); } |
|
|
|
void dbgln(const char* format); |
|
|
|
template<typename... P> void infoln(const char* format, P&&... parameters) { return dbgln(Log::Info, true, format, std::forward<P>(parameters)...); } |
|
|
|
void dbgln(Log type, const char* format); |
|
|
|
template<typename... P> void warnln(const char* format, P&&... parameters) { return dbgln(Log::Warn, true, format, std::forward<P>(parameters)...); } |
|
|
|
void dbgln(Log type, bool newline, const char* format); |
|
|
|
template<typename... P> void dangerln(const char* format, P&&... parameters) { return dbgln(Log::Danger, true, format, std::forward<P>(parameters)...); } |
|
|
|
void dbgln(std::string format); |
|
|
|
template<typename... P> void successln(const char* format, P&&... parameters) { return dbgln(Log::Success, true, format, std::forward<P>(parameters)...); } |
|
|
|
void dbgln(Log type, std::string format); |
|
|
|
template<typename... P> void commentln(const char* format, P&&... parameters) { return dbgln(Log::Comment, true, format, std::forward<P>(parameters)...); } |
|
|
|
void dbgln(Log type, bool newline, std::string format); |
|
|
|
|
|
|
|
void dbgln(std::string_view format); |
|
|
|
template<typename... P> void dbgln(const std::string& format, P&&... parameters) { return dbgln(Log::None, true, format.c_str(), std::forward<P>(parameters)...); } |
|
|
|
void dbgln(Log type, std::string_view format); |
|
|
|
template<typename... P> void infoln(const std::string& format, P&&... parameters) { return dbgln(Log::Info, true, format.c_str(), std::forward<P>(parameters)...); } |
|
|
|
void dbgln(Log type, bool newline, std::string_view format); |
|
|
|
template<typename... P> void warnln(const std::string& format, P&&... parameters) { return dbgln(Log::Warn, true, format.c_str(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void dangerln(const std::string& format, P&&... parameters) { return dbgln(Log::Danger, true, format.c_str(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void successln(const std::string& format, P&&... parameters) { return dbgln(Log::Success, true, format.c_str(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void commentln(const std::string& format, P&&... parameters) { return dbgln(Log::Comment, true, format.c_str(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename... P> void dbgln(const std::string_view& format, P&&... parameters) { return dbgln(Log::None, true, format.data(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void infoln(const std::string_view& format, P&&... parameters) { return dbgln(Log::Info, true, format.data(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void warnln(const std::string_view& format, P&&... parameters) { return dbgln(Log::Warn, true, format.data(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void dangerln(const std::string_view& format, P&&... parameters) { return dbgln(Log::Danger, true, format.data(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void successln(const std::string_view& format, P&&... parameters) { return dbgln(Log::Success, true, format.data(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void commentln(const std::string_view& format, P&&... parameters) { return dbgln(Log::Comment, true, format.data(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename... P> void dbgln(bool newline, const char* format, P&&... parameters) { return dbgln(Log::None, newline, format, std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void infoln(bool newline, const char* format, P&&... parameters) { return dbgln(Log::Info, newline, format, std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void warnln(bool newline, const char* format, P&&... parameters) { return dbgln(Log::Warn, newline, format, std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void dangerln(bool newline, const char* format, P&&... parameters) { return dbgln(Log::Danger, newline, format, std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void successln(bool newline, const char* format, P&&... parameters) { return dbgln(Log::Success, newline, format, std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void commentln(bool newline, const char* format, P&&... parameters) { return dbgln(Log::Comment, newline, format, std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename... P> void dbgln(bool newline, const std::string& format, P&&... parameters) { return dbgln(Log::None, newline, format.c_str(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void infoln(bool newline, const std::string& format, P&&... parameters) { return dbgln(Log::Info, newline, format.c_str(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void warnln(bool newline, const std::string& format, P&&... parameters) { return dbgln(Log::Warn, newline, format.c_str(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void dangerln(bool newline, const std::string& format, P&&... parameters) { return dbgln(Log::Danger, newline, format.c_str(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void successln(bool newline, const std::string& format, P&&... parameters) { return dbgln(Log::Success, newline, format.c_str(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void commentln(bool newline, const std::string& format, P&&... parameters) { return dbgln(Log::Comment, newline, format.c_str(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename... P> void dbgln(bool newline, const std::string_view& format, P&&... parameters) { return dbgln(Log::None, newline, format.data(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void infoln(bool newline, const std::string_view& format, P&&... parameters) { return dbgln(Log::Info, newline, format.data(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void warnln(bool newline, const std::string_view& format, P&&... parameters) { return dbgln(Log::Warn, newline, format.data(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void dangerln(bool newline, const std::string_view& format, P&&... parameters) { return dbgln(Log::Danger, newline, format.data(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void successln(bool newline, const std::string_view& format, P&&... parameters) { return dbgln(Log::Success, newline, format.data(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
template<typename... P> void commentln(bool newline, const std::string_view& format, P&&... parameters) { return dbgln(Log::Comment, newline, format.data(), std::forward<P>(parameters)...); } |
|
|
|
|
|
|
|
|
|
|
|
template<typename T, typename... P> |
|
|
|
// -----------------------------------------
|
|
|
|
void dbgln(const char* format, T value, P&&... parameters) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dbgln(Log::None, format, value, std::forward<P>(parameters)...); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename T, typename... P> |
|
|
|
void dbgln(Log type, bool newline); |
|
|
|
void dbgln(Log type, const char* format, T value, P&&... parameters) |
|
|
|
void dbgln(Log type, bool newline, const char* format); |
|
|
|
{ |
|
|
|
|
|
|
|
dbgln(type, true, format, value, std::forward<P>(parameters)...); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// https://en.cppreference.com/w/cpp/language/parameter_pack#Example
|
|
|
|
// https://en.cppreference.com/w/cpp/language/parameter_pack#Example
|
|
|
|
template<typename T, typename... P> |
|
|
|
template<typename T, typename... P> |
|
|
@ -176,7 +209,7 @@ namespace Inferno { |
|
|
|
while(format[i] != '\0') { |
|
|
|
while(format[i] != '\0') { |
|
|
|
|
|
|
|
|
|
|
|
if (format[i] == '{' && format[i + 1] == '}') { |
|
|
|
if (format[i] == '{' && format[i + 1] == '}') { |
|
|
|
dbg(type, false) << view.substr(0, i) << value; |
|
|
|
DebugLogStream(type, false) << view.substr(0, i) << value; |
|
|
|
dbgln(type, newline, format + i + 2, parameters...); |
|
|
|
dbgln(type, newline, format + i + 2, parameters...); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -185,42 +218,6 @@ namespace Inferno { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template<typename T, typename... P> |
|
|
|
|
|
|
|
void dbgln(std::string format, T value, P&&... parameters) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dbgln(format.c_str(), value, std::forward<P>(parameters)...); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename T, typename... P> |
|
|
|
|
|
|
|
void dbgln(Log type, std::string format, T value, P&&... parameters) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dbgln(type, format.c_str(), value, std::forward<P>(parameters)...); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename T, typename... P> |
|
|
|
|
|
|
|
void dbgln(Log type, bool newline, std::string format, T value, P&&... parameters) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dbgln(type, newline, format.c_str(), value, std::forward<P>(parameters)...); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename T, typename... P> |
|
|
|
|
|
|
|
void dbgln(std::string_view format, T value, P&&... parameters) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dbgln(format.data(), value, std::forward<P>(parameters)...); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename T, typename... P> |
|
|
|
|
|
|
|
void dbgln(Log type, std::string_view format, T value, P&&... parameters) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dbgln(type, format.data(), value, std::forward<P>(parameters)...); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename T, typename... P> |
|
|
|
|
|
|
|
void dbgln(Log type, bool newline, std::string_view format, T value, P&&... parameters) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dbgln(type, newline, format.data(), value, std::forward<P>(parameters)...); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------
|
|
|
|
// -----------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
StringLogStream str(std::string* fill); |
|
|
|
StringLogStream str(std::string* fill); |
|
|
|