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