diff --git a/src/ray/util/logging.h b/src/ray/util/logging.h index 35bb9841d..daaa92369 100644 --- a/src/ray/util/logging.h +++ b/src/ray/util/logging.h @@ -35,7 +35,9 @@ namespace ray { #define RAY_LOG_INTERNAL(level) ::ray::RayLog(__FILE__, __LINE__, level) -#define RAY_LOG(level) RAY_LOG_INTERNAL(RAY_##level) +#define RAY_LOG(level) \ + if (ray::RayLog::IsLevelEnabled(RAY_##level)) RAY_LOG_INTERNAL(RAY_##level) + #define RAY_IGNORE_EXPR(expr) ((void)(expr)) #define RAY_CHECK(condition) \