Specify different message formatting for `uvm_info, `uvm_warning, etc messages displayed on stdout and for those printed in log

since you are already customizing the report server,
I would suggest trying to overload the f_display function in the uvm_report_server.
this function :

// f_display
//
// This method sends string severity to the command line if file is 0 and to
// the file(s) specified by file if it is not 0.

function void f_display(UVM_FILE file, string str);
if (file == 0)
$display(“%s”, str);
else
$fdisplay(file, “%s”, str);
endfunction

can be overridden by either this :

function void f_display(UVM_FILE file, string str);
if (file == 0)
$display(“%s” ,str);
else
$fdisplay(file, “%s”, strip_ansi(str));
endfunction

and implement an strip_ansi function that looks for and removes the ansi sequences from the string.