|
CG_Labs 2021.2
|
Go to the source code of this file.
Namespaces | |
| namespace | Log |
Macros | |
| #define | SUCCESS(r) ((r) == RESULT_SUCCESS) |
| #define | FAILURE(r) (!SUCCESS(r)) |
| #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__) |
| #define | Param(m) Log::ReportParam(static_cast<unsigned int>(m), __FILE__, __FUNCTION__, __LINE__) |
| #define | LOG_MESSAGE_ONCE_FLAG 1 |
| #define | LOG_LOCATION_ONCE_FLAG 2 |
| #define | LOG_OUT_STD (1 << 0) |
| #define | LOG_OUT_FILE (1 << 1) |
| #define | LOG_OUT_CUSTOM (1 << 15) |
| #define | Log(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_NEUTRAL, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define | LogType(t, m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, t, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define | LogMsgOnce(t, m, ...) Log::Report(LOG_MESSAGE_ONCE_FLAG, __FILE__, __FUNCTION__, __LINE__, t, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define | LogLocOnce(t, m, ...) Log::Report(LOG_LOCATION_ONCE_FLAG, __FILE__, __FUNCTION__, __LINE__, t, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define | LogWarning(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_WARNING, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define | LogError(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_ERROR, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define | LogFile(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_FILE, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define | LogInfo(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_INFO, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define | LogTrivia(m, ...) Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_TRIVIA, static_cast<char const*>(m), ##__VA_ARGS__) |
Enumerations | |
| enum | Log::Type { Log::TYPE_SUCCESS = 0 , Log::TYPE_INFO = 1 , Log::TYPE_NEUTRAL = 2 , Log::TYPE_WARNING = 3 , Log::TYPE_ERROR = 4 , Log::TYPE_FILE = 5 , Log::TYPE_ASSERT = 6 , Log::TYPE_PARAM = 7 , Log::TYPE_TRIVIA = 8 , Log::N_TYPES = 9 } |
| enum | Log::Severity { Log::OK = 0 , Log::BAD , Log::TERMINAL } |
| enum | Log::Verbosity { Log::WHISPER = 0 , Log::LOUD_UNSITUATED , Log::LOUD } |
Functions | |
| void | Log::Init () |
| void | Log::Destroy () |
| void | Log::SetCustomOutputTargetFunc (void(*textout)(Type, const char *)) |
| void | Log::SetOutputTargets (std::size_t targets) |
| void | Log::SetVerbosity (Type type, Verbosity verbosity) |
| void | Log::SetIncludeThreadID (bool inc) |
| void | Log::Report (unsigned int flags, const char *file, const char *function, int line, Type type, const char *str,...) |
| bool | Log::ReportParam (unsigned int test, const char *file, const char *function, int line) |
| #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__) |
| #define FAILURE | ( | r | ) | (!SUCCESS(r)) |
| #define Log | ( | m, | |
| ... | |||
| ) | Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_NEUTRAL, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define LOG_LOCATION_ONCE_FLAG 2 |
| #define LOG_MESSAGE_ONCE_FLAG 1 |
| #define LOG_OUT_CUSTOM (1 << 15) |
| #define LOG_OUT_FILE (1 << 1) |
| #define LOG_OUT_STD (1 << 0) |
| #define LogError | ( | m, | |
| ... | |||
| ) | Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_ERROR, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define LogFile | ( | m, | |
| ... | |||
| ) | Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_FILE, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define LogInfo | ( | m, | |
| ... | |||
| ) | Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_INFO, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define LogLocOnce | ( | t, | |
| m, | |||
| ... | |||
| ) | Log::Report(LOG_LOCATION_ONCE_FLAG, __FILE__, __FUNCTION__, __LINE__, t, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define LogMsgOnce | ( | t, | |
| m, | |||
| ... | |||
| ) | Log::Report(LOG_MESSAGE_ONCE_FLAG, __FILE__, __FUNCTION__, __LINE__, t, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define LogTrivia | ( | m, | |
| ... | |||
| ) | Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_TRIVIA, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define LogType | ( | t, | |
| m, | |||
| ... | |||
| ) | Log::Report(0, __FILE__, __FUNCTION__, __LINE__, t, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define LogWarning | ( | m, | |
| ... | |||
| ) | Log::Report(0, __FILE__, __FUNCTION__, __LINE__, Log::Type::TYPE_WARNING, static_cast<char const*>(m), ##__VA_ARGS__) |
| #define Param | ( | m | ) | Log::ReportParam(static_cast<unsigned int>(m), __FILE__, __FUNCTION__, __LINE__) |
| #define SUCCESS | ( | r | ) | ((r) == RESULT_SUCCESS) |