tags:

views:

77

answers:

2

I think the question title says it all, but, I connect to a running node with the -remsh flag, and I run my usual Common Test sanity tests, but none of the error_logger:info_msg messages appear in the shell. Why?

A: 

Well, I don't know the answer, but I see I can run regular old erl from run_erl and then connect to it via to_erl. I thought you could only use those if you had a embedded target system set up, which i don't, and don't want to hassle with.

+1  A: 

The SASL default event handler will only write events to console/tty of the local node. When connecting via "-remsh", you're starting a second node and communicating via message passing to the first. The output from the "nodes()" BIF can confirm this.

Calls to the error_logger functions will send events to the local 'error_logger' registered process, which is a gen_event server. You can manipulate it using error_logger:tty/1 and error_logger:logfile/1, see the reference docs in the "Basic" Application Group, then the "kernel" application, then the "error_logger" module.

You can also add your own event handler to the 'error_logger' server, which can then do anything you want with the event. I'd guess that error_logger:logfile/1 might be sufficient for your purposes, though.

-Scott

Scott Lystig Fritchie