You can specify the 1st argument in io: format / 3 format in the second node using the result of erlang: group_leader () from the first node.
Starting first with a node, registering the local group of the shell process group globally:
erl -sname a ( a@localhost )1> global:register_name(global_io_srv, group_leader()). yes
Starting from the second node, connecting using a globally registered process as an io device
erl -sname b ( b@localhost )1> net_kernel:connect( a@localhost ). true ( b@localhost )2> io:format(global:whereis_name(global_io_srv),"test output",[]). ok
You will see the test output in the first node. This is just as the Christian suggested, a little more explicit. That way you can have error_logger for production logging and io: format / 3 for quick debugging only.
source share