Uvm_info's to output file

Hi ,

i am trying to send uvm_info messages based on ID to a seperate file. but file is always null.( there are no MSG’s)

Here is my code :



class capture_agt extends uvm_component;
int logfile;
.......
.......

task main_phase (uvm_phase phase);
    logfile = $fopen("../../capture.log","w");
    uvm_top.set_report_default_file_hier(logfile);
    uvm_top.set_report_severity_id_action_hier(UVM_INFO, "TS_MON" , UVM_DISPLAY | UVM_LOG);
    ........
    ........
    $fclose(logfile);
endtask : main_phase
.......
.......

endclass 


i trying to put infos with ID=“TS_MON” in to seperate file…but its not working

Thanks

In reply to lalithjithan:
Does your ID string “TS_MON” exist? Please double check.
For declaration you should use
UVM_FILE logfile;
And please use run_phase instead of main_phase.
Using the run_phase sub-phases is not recommended.