diff --git a/runtime-light/stdlib/diagnostics/error-handling-functions.h b/runtime-light/stdlib/diagnostics/error-handling-functions.h index bacfc91a1f..0f821ec5eb 100644 --- a/runtime-light/stdlib/diagnostics/error-handling-functions.h +++ b/runtime-light/stdlib/diagnostics/error-handling-functions.h @@ -103,27 +103,13 @@ inline int64_t f$error_reporting(Optional new_error_level_opt = {}) noe return current_error_level; } - int64_t new_error_level{new_error_level_opt.val()}; - if (new_error_level != 0 && (new_error_level & ErrorHandlingState::SUPPORTED_ERROR_LEVELS) == 0) { - // ignore error_level if it's unsupported - return current_error_level; - } error_handling_st.minimum_log_level = 0; - if (new_error_level == 0) { - return current_error_level; - } else if ((new_error_level & E_ALL) == E_ALL) { - error_handling_st.minimum_log_level |= static_cast(E_ALL); + if (int64_t new_error_level{new_error_level_opt.val()}; new_error_level == 0) { return current_error_level; } - if ((new_error_level & E_NOTICE) == E_NOTICE) { - error_handling_st.minimum_log_level |= static_cast(E_NOTICE); - } - if ((new_error_level & E_WARNING) == E_WARNING) { - error_handling_st.minimum_log_level |= static_cast(E_WARNING); - } - if ((new_error_level & E_ERROR) == E_ERROR) { - error_handling_st.minimum_log_level |= static_cast(E_ERROR); - } + // currently only minimum_log_level == 0 and minimum_log_level == E_ALL are supported, + // because behavior in the runtime/ and runtime-light/ is different. we will fix this in the future. + error_handling_st.minimum_log_level = static_cast(E_ALL); return current_error_level; }