diff --git a/runtime-light/stdlib/diagnostics/error-handling-state.h b/runtime-light/stdlib/diagnostics/error-handling-state.h index 3255f18878..c4badcd46b 100644 --- a/runtime-light/stdlib/diagnostics/error-handling-state.h +++ b/runtime-light/stdlib/diagnostics/error-handling-state.h @@ -14,6 +14,7 @@ struct ErrorHandlingState final : vk::not_copyable { int64_t minimum_log_level{E_ALL}; + const RuntimeContext& runtime_context{RuntimeContext::get()}; static constexpr std::string_view INI_ERROR_REPORTING_KEY = "error_reporting"; static constexpr int64_t SUPPORTED_ERROR_LEVELS = E_ERROR | E_WARNING | E_NOTICE; @@ -21,6 +22,10 @@ struct ErrorHandlingState final : vk::not_copyable { ErrorHandlingState() noexcept; bool log_level_enabled(int64_t level) const noexcept { + if (runtime_context.php_disable_warnings > 0 && (level & E_ERROR) == 0) { + // log level disabled by error control operator @ + return false; + } return (minimum_log_level & level) != 0; }