14#define SUCCESS(r) ((r) == RESULT_SUCCESS)
15#define FAILURE(r) (!SUCCESS(r))
17#if defined ENABLE_ASSERT && ENABLE_ASSERT != 0
18# define Assert(m) if (!(static_cast<unsigned int>(m))) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_ASSERT, "Assertion failed at line %u in file %s.", __LINE__, __FILE__)
23#if defined ENABLE_PARAM_CHECK && ENABLE_PARAM_CHECK != 0
24# define Param(m) Log::ReportParam(static_cast<unsigned int>(m), __FILE__, __FUNCTION__, __LINE__)
29#define LOG_MESSAGE_ONCE_FLAG 1
30#define LOG_LOCATION_ONCE_FLAG 2
58#define LOG_OUT_STD (1 << 0)
59#define LOG_OUT_FILE (1 << 1)
60#define LOG_OUT_CUSTOM (1 << 15)
64void SetCustomOutputTargetFunc(
void (* textout)(Type,
const char *));
95# define Log(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_NEUTRAL, static_cast<char const*>(m), __VA_ARGS__)
96# define LogType(t, m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, t, static_cast<char const*>(m), __VA_ARGS__)
97# define LogMsgOnce(t, m, ...) Log::Report(LOG_MESSAGE_ONCE_FLAG, __FILE__, __FUNCTION__, __LINE__, t, static_cast<char const*>(m), __VA_ARGS__)
98# define LogLocOnce(t, m, ...) Log::Report(LOG_LOCATION_ONCE_FLAG, __FILE__, __FUNCTION__, __LINE__, t, static_cast<char const*>(m), __VA_ARGS__)
99# define LogWarning(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_WARNING, static_cast<char const*>(m), __VA_ARGS__)
100# define LogError(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_ERROR, static_cast<char const*>(m), __VA_ARGS__)
101# define LogFile(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_FILE, static_cast<char const*>(m), __VA_ARGS__)
102# define LogInfo(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_INFO, static_cast<char const*>(m), __VA_ARGS__)
103# define LogTrivia(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_TRIVIA, static_cast<char const*>(m), __VA_ARGS__)
105# define Log(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_NEUTRAL, static_cast<char const*>(m), ##__VA_ARGS__)
106# define LogType(t, m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, t, static_cast<char const*>(m), ##__VA_ARGS__)
107# define LogMsgOnce(t, m, ...) Log::Report(LOG_MESSAGE_ONCE_FLAG, __FILE__, __FUNCTION__, __LINE__, t, static_cast<char const*>(m), ##__VA_ARGS__)
108# define LogLocOnce(t, m, ...) Log::Report(LOG_LOCATION_ONCE_FLAG, __FILE__, __FUNCTION__, __LINE__, t, static_cast<char const*>(m), ##__VA_ARGS__)
109# define LogWarning(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_WARNING, static_cast<char const*>(m), ##__VA_ARGS__)
110# define LogError(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_ERROR, static_cast<char const*>(m), ##__VA_ARGS__)
111# define LogFile(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_FILE, static_cast<char const*>(m), ##__VA_ARGS__)
112# define LogInfo(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_INFO, static_cast<char const*>(m), ##__VA_ARGS__)
113# define LogTrivia(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_TRIVIA, static_cast<char const*>(m), ##__VA_ARGS__)
void Report(unsigned int flags, const char *file, const char *function, int line, Type type, const char *str,...)
Definition Log.cpp:116
Verbosity
Definition Log.h:52
@ WHISPER
Definition Log.h:53
@ LOUD
Definition Log.h:55
@ LOUD_UNSITUATED
Definition Log.h:54
bool ReportParam(unsigned int test, const char *file, const char *function, int line)
Definition Log.cpp:200
void SetIncludeThreadID(bool inc)
Definition Log.cpp:109
Severity
Definition Log.h:47
@ TERMINAL
Definition Log.h:50
void SetVerbosity(Type type, Verbosity verbosity)
Definition Log.cpp:102
void SetOutputTargets(size_t flags)
Definition Log.cpp:78
@ TYPE_FILE
Definition Log.h:40
@ TYPE_ASSERT
Definition Log.h:41
@ N_TYPES
Definition Log.h:44
@ TYPE_ERROR
Definition Log.h:39
@ TYPE_PARAM
Definition Log.h:42
@ TYPE_NEUTRAL
Definition Log.h:37
@ TYPE_SUCCESS
Definition Log.h:35
@ TYPE_TRIVIA
Definition Log.h:43
@ TYPE_WARNING
Definition Log.h:38
@ TYPE_INFO
Definition Log.h:36