Log debug prints from sequences to file

How to log debug prints from sequences to a report file?
For example, let us say I have an agent “agent1” and the report file associated with that agent, to log all messages from the driver and monitor, be “agent1.rpt”. I am able to log the debug prints from driver and monitor to the file successfully.
I also want to add debug prints emanating from the sequences related to the “agent1” in the same report file “agent1.rpt”.

How do I do this?

If you use `uvm_info_context(ID,MESSAGE,VERBOSITY,m_sequencer) inside your sequence, then all info messages will be reported as if they came from the agent’s sequencer. The message will use whatever report file settings have been applied to that component.

If all the messages from a particular sequence use an ID that is unique to a particular agent, you can use set_report_id_file(ID,FILE) as an alternative.

In reply to dave_59:

Thank you!
Is the same available in OVM as well?? Or is there any other method with OVM?

In reply to raghavang:

set_report_id_file existis in the OVM as well.

The OVM does not have `ovm_info_context, but you can do

m_sequencer.ovm_report_info(…);

In reply to dave_59:

Thank you for your support! It is working.
Can we extend similar logic to prints from seq_item ??

In reply to raghavang:

Yes, o/uvm_sequence_item is where m_sequencer is defined.