Allow error message to be formatted

This commit is contained in:
SirLynix
2023-08-14 23:16:37 +02:00
committed by Jérôme Leclercq
parent 25957c4b7f
commit a741672a51
119 changed files with 707 additions and 490 deletions

View File

@@ -15,12 +15,12 @@
#include <string>
#ifdef NAZARA_DEBUG
#define NazaraDebug(txt) NazaraNotice(txt)
#define NazaraDebug(...) NazaraNotice(__VA_ARGS__)
#else
#define NazaraDebug(txt)
#define NazaraDebug(...)
#endif
#define NazaraNotice(txt) Nz::Log::Write(txt)
#define NazaraNotice(...) Nz::Log::Write(__VA_ARGS__)
namespace Nz
{
@@ -39,7 +39,8 @@ namespace Nz
static void SetLogger(AbstractLogger* logger);
static void Write(std::string_view string);
static void Write(std::string_view str);
template<typename... Args> static void Write(std::string_view str, Args&&... args);
static void WriteError(ErrorType type, std::string_view error, unsigned int line = 0, const char* file = nullptr, const char* function = nullptr);
NazaraStaticSignal(OnLogWrite, const std::string_view& /*string*/);
@@ -54,4 +55,6 @@ namespace Nz
};
}
#include <Nazara/Core/Log.inl>
#endif // NAZARA_CORE_LOG_HPP