diff --git a/tools/vrs/VrsCommand.cpp b/tools/vrs/VrsCommand.cpp index 797fa245..94cac2d6 100644 --- a/tools/vrs/VrsCommand.cpp +++ b/tools/vrs/VrsCommand.cpp @@ -18,9 +18,7 @@ #include #include -#include #include -#include #include #define DEFAULT_LOG_CHANNEL "VrsCommand" diff --git a/tools/vrs/vrs.cpp b/tools/vrs/vrs.cpp index 469fdd72..16290dec 100644 --- a/tools/vrs/vrs.cpp +++ b/tools/vrs/vrs.cpp @@ -16,8 +16,6 @@ #include "VrsCommand.h" -#include - #include using namespace std; diff --git a/vrs/oss/logging/Checks.cpp b/vrs/oss/logging/Checks.cpp index 34e231a8..0b06d269 100644 --- a/vrs/oss/logging/Checks.cpp +++ b/vrs/oss/logging/Checks.cpp @@ -17,11 +17,14 @@ #include "Checks.h" #include + #include #include #include +#include + // Abort Macro. #if IS_ANDROID_PLATFORM() #include @@ -41,7 +44,7 @@ namespace vrs { namespace logging { -void logAndAbort(const std::string& condition, const std::string& message) { +void logAndAbort(const char* condition, const std::string& message) { fmt::print(stderr, fg(fmt::color::red), "{} {}", condition, message); XR_ABORT_IMPL(message); } diff --git a/vrs/oss/logging/Checks.h b/vrs/oss/logging/Checks.h index cf475acf..c82cf0e4 100644 --- a/vrs/oss/logging/Checks.h +++ b/vrs/oss/logging/Checks.h @@ -20,14 +20,10 @@ #include -#include - -#include "LogLevel.h" - namespace vrs { namespace logging { -void logAndAbort(const std::string& condition, const std::string& message = {}); +void logAndAbort(const char* condition, const std::string& message = {}); } // namespace logging } // namespace vrs @@ -36,10 +32,10 @@ void logAndAbort(const std::string& condition, const std::string& message = {}); // Check Macros. // -#define XR_CHECK_FORMAT(condition, ...) \ - (condition ? 0 : ((vrs::logging::logAndAbort(#condition, fmt::format(__VA_ARGS__))), 0)) +#define XR_CHECK_FORMAT(condition, fmtstr, ...) \ + (condition ? 0 : ((vrs::logging::logAndAbort(#condition, fmt::format(fmtstr, ##__VA_ARGS__))), 0)) -#define XR_CHECK(condition, ...) XR_CHECK_FORMAT(condition, ##__VA_ARGS__, "") +#define XR_CHECK(condition, ...) XR_CHECK_FORMAT(condition, "" __VA_ARGS__) #define XR_CHECK_EQ(val1, val2, ...) XR_CHECK((val1) == (val2), ##__VA_ARGS__) diff --git a/vrs/oss/logging/Verify.h b/vrs/oss/logging/Verify.h index c6f1276c..a70fac6f 100644 --- a/vrs/oss/logging/Verify.h +++ b/vrs/oss/logging/Verify.h @@ -19,10 +19,6 @@ #include #include -#include - -#include "LogLevel.h" - #ifndef DEFAULT_LOG_CHANNEL #error "DEFAULT_LOG_CHANNEL must be defined before including " #endif // DEFAULT_LOG_CHANNEL @@ -33,14 +29,15 @@ // condition. // -#define XR_VERIFY_C(channel_, condition_, ...) \ - (condition_ ? 1 \ - : (fmt::print( \ - stderr, \ - fg(fmt::color::red), \ - "Verify {} failed: {}", \ - #condition_, \ - fmt::format(__VA_ARGS__)), \ +#define XR_VERIFY_C(channel_, condition_, fmtstr, ...) \ + (condition_ ? 1 \ + : (fmt::print( \ + stderr, \ + fg(fmt::color::red), \ + "{}: Verify {} failed. {}\n", \ + channel_, \ + #condition_, \ + fmt::format(fmtstr, ##__VA_ARGS__)), \ 0)) -#define XR_VERIFY(cond, ...) XR_VERIFY_C(DEFAULT_LOG_CHANNEL, cond, ##__VA_ARGS__, "") +#define XR_VERIFY(cond, ...) XR_VERIFY_C(DEFAULT_LOG_CHANNEL, cond, "" __VA_ARGS__)