diff options
Diffstat (limited to 'zencore')
| -rw-r--r-- | zencore/include/zencore/logging.h | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/zencore/include/zencore/logging.h b/zencore/include/zencore/logging.h index 4eee20414..8e6b3a244 100644 --- a/zencore/include/zencore/logging.h +++ b/zencore/include/zencore/logging.h @@ -39,11 +39,44 @@ using zen::Log; // Helper macros for logging -using namespace std::literals; - -#define ZEN_TRACE(fmtstr, ...) Log().trace(fmtstr##sv, __VA_ARGS__) -#define ZEN_DEBUG(fmtstr, ...) Log().debug(fmtstr##sv, __VA_ARGS__) -#define ZEN_INFO(fmtstr, ...) Log().info(fmtstr##sv, __VA_ARGS__) -#define ZEN_WARN(fmtstr, ...) Log().warn(fmtstr##sv, __VA_ARGS__) -#define ZEN_ERROR(fmtstr, ...) Log().error(fmtstr##sv, __VA_ARGS__) -#define ZEN_CRITICAL(fmtstr, ...) Log().critical(fmtstr##sv, __VA_ARGS__) +#define ZEN_TRACE(fmtstr, ...) \ + do \ + { \ + using namespace std::literals; \ + Log().trace(fmtstr##sv, __VA_ARGS__); \ + } while (false) + +#define ZEN_DEBUG(fmtstr, ...) \ + do \ + { \ + using namespace std::literals; \ + Log().debug(fmtstr##sv, __VA_ARGS__); \ + } while (false) + +#define ZEN_INFO(fmtstr, ...) \ + do \ + { \ + using namespace std::literals; \ + Log().info(fmtstr##sv, __VA_ARGS__); \ + } while (false) + +#define ZEN_WARN(fmtstr, ...) \ + do \ + { \ + using namespace std::literals; \ + Log().warn(fmtstr##sv, __VA_ARGS__); \ + } while (false) + +#define ZEN_ERROR(fmtstr, ...) \ + do \ + { \ + using namespace std::literals; \ + Log().error(fmtstr##sv, __VA_ARGS__); \ + } while (false) + +#define ZEN_CRITICAL(fmtstr, ...) \ + do \ + { \ + using namespace std::literals; \ + Log().critical(fmtstr##sv, __VA_ARGS__); \ + } while (false) |