Can we use set_report_severity_id_override twice in testcase

Hi,
I am trying to use set_report_severity_id_override for specific task and changing back to normal again, after task completion. Can we use it for twice in same testcase. Is it possible? If not best way to use?

Ex:
task run_phase();
chk();
uvm_top.set_report_severity_id_override(UVM_WARNING,“UVM_STATUS”,UVM_ERROR);
endtask

task chk();
uvm_top.set_report_severity_id_override(UVM_ERROR,“UVM_STATUS”,UVM_WARNING);
endtask

In reply to shawnbay:

Yes, last setting wins. Note that uvm_component does not provide convenience method for this setting. If you want to set an entire component hierarchy, you’ll need to traverse it and apply to each component.

In reply to dave_59:

Correct me if I am wrong, You mean it should work twice if I set in first task which sets first setting and next it keeps last setting which is kept after that task.