Uvm_report_catcher

My log file has several lines that contain the following string (as an example):-
MY_ERROR
Please note that “MY_ERROR” is the output of legacy $display statements, that I cannot convert to UVM_ERROR.

Is there a way I can “catch” MY_ERROR and take further action?
The code shown below does not work.

Thank You!


    function action_e catch; 
        uvm_severity severity  = get_severity();
        string       id        = get_id();
        uvm_action   action    = get_action();
        string       message   = get_message();
        int          verbosity = get_verbosity();

        if (uvm_is_match({"*MY_ERROR*"},get_message())) begin 
            $display("Success!"); $finish;
	end
        return THROW;
    endfunction


In reply to new_to_uvm:

If you can see the code where the $display(args) exists, you can change it to uvm_pkg::uvm_report_info(“display”,$sformatf(args), UVM_LOW).

Dave,
I really liked your DVCON paper.
Thanks!