Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions runtime-light/stdlib/diagnostics/error-handling-functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,27 +103,13 @@ inline int64_t f$error_reporting(Optional<int64_t> 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<int64_t>(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<int64_t>(E_NOTICE);
}
if ((new_error_level & E_WARNING) == E_WARNING) {
error_handling_st.minimum_log_level |= static_cast<int64_t>(E_WARNING);
}
if ((new_error_level & E_ERROR) == E_ERROR) {
error_handling_st.minimum_log_level |= static_cast<int64_t>(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<int64_t>(E_ALL);
return current_error_level;
}
Loading