28#ifndef YACLIB_FUNC_NAME
29# if defined(__clang__) || defined(__GNUC__)
30# define YACLIB_FUNC_NAME __PRETTY_FUNCTION__
31# elif defined(_MSC_VER)
32# define YACLIB_FUNC_NAME __FUNCSIG__
34# define YACLIB_FUNC_NAME __func__
38#define YACLIB_LOG_MESSAGE(level, cond, message) \
41 ::yaclib::detail::LogMessage(level, __FILE__, __LINE__, YACLIB_FUNC_NAME, #cond, (message)); \
45#define YACLIB_SET_CALLBACK(level, callback) \
47 ::yaclib::detail::SetCallback(level, (callback)); \
51# define YACLIB_STUB1(first) ((void)1)
52# define YACLIB_STUB2(first, second) ((void)1)
54# define YACLIB_STUB1(first) \
60# define YACLIB_STUB2(first, second) \
70# define YACLIB_INIT_WARN(callback) YACLIB_SET_CALLBACK(::yaclib::detail::LogLevel::Warn, callback)
71# define YACLIB_WARN(cond, message) YACLIB_LOG_MESSAGE(::yaclib::detail::LogLevel::Warn, cond, message)
73# define YACLIB_INIT_WARN(callback) YACLIB_STUB1(callback)
74# define YACLIB_WARN(cond, message) YACLIB_STUB2(cond, message)
77#ifdef YACLIB_LOG_DEBUG
78# define YACLIB_INIT_DEBUG(callback) YACLIB_SET_CALLBACK(::yaclib::detail::LogLevel::Debug, callback)
79# define YACLIB_DEBUG(cond, message) YACLIB_LOG_MESSAGE(::yaclib::detail::LogLevel::Debug, cond, message)
80# define YACLIB_ASSERT(cond) YACLIB_LOG_MESSAGE(::yaclib::detail::LogLevel::Debug, !(cond), "")
81# define YACLIB_PURE_VIRTUAL() YACLIB_LOG_MESSAGE(::yaclib::detail::LogLevel::Debug, true, "Pure virtual call!")
83# define YACLIB_INIT_DEBUG(callback) YACLIB_STUB1(callback)
84# define YACLIB_DEBUG(cond, message) YACLIB_STUB2(cond, message)
85# define YACLIB_ASSERT(cond) YACLIB_STUB1(!(cond))
86# define YACLIB_PURE_VIRTUAL() YACLIB_STUB1(true)
auto SetCallback(ResultCorePtr< Arg, E > &core, IExecutor *executor, Func &&f)
void LogMessage(LogLevel level, std::string_view file, std::size_t line, std::string_view func, std::string_view condition, std::string_view message) noexcept
Contract< V, E > MakeContract()
Creates related future and promise.
void(*)(std::string_view file, std::size_t line, std::string_view function, std::string_view condition, std::string_view message) noexcept LogCallback