you could try something like this every time you want to log something:
Please note that all debug output you send this way will also be sent to the Modus RTU server. This could potentially lead to unwanted results, should the parser in the Modbus RTU server choke on it.
In addition you'll see everything the Modbus RTU server is sending back in the log as well.
As an alternative you could use a second serial connection for debug output through one of the Groove ports using a separate USB Serial converter. E.g. like this:
Serial1.begin(115200, SERIAL_8N1, 16, 17);