ooici/pyon — pull request #214 by daf (2013-01-04 15:02:58+00:00)
Title: Print greenlets on USR2

Prints to stderr (if possible) and to a file, `gls-`. When the `-n` option is specified, embedded ipython does not allow printing to stdout/stderr.

Report sample output:

```
Greenlet at 0x103ff7c30:
self: ProcessRPCServer at 0x104010750:
recv_name: NP (dd,ASA-DEVELOPERs-MacBook-Pro_local_12376.1,B: ASA-DEVELOPERs-MacBook-Pro_local_12376.1)
process: HelloService(name=hello,id=ASA-DEVELOPERs-MacBook-Pro_local_12376.1,type=service)
func: bound, ProcessRPCServer.listen
traceback:
File "/Users/asadeveloper/Documents/Dev/code/pyon/eggs/gevent-0.13.7-py2.7-macosx-10.6-x86_64.egg/gevent/greenlet.py", line 390, in run
result = self._run(*self.args, **self.kwargs)
File "/Users/asadeveloper/Documents/Dev/code/pyon/pyon/net/endpoint.py", line 486, in listen
m = self.get_one_msg()
File "/Users/asadeveloper/Documents/Dev/code/pyon/pyon/net/endpoint.py", line 585, in get_one_msg
mos = self._get_n_msgs(num=1, timeout=timeout)
File "/Users/asadeveloper/Documents/Dev/code/pyon/pyon/net/endpoint.py", line 557, in _get_n_msgs
newch = self._chan.accept(n=num, timeout=timeout)
File "/Users/asadeveloper/Documents/Dev/code/pyon/pyon/net/channel.py", line 924, in accept
ar.get(timeout=timeout)
File "/Users/asadeveloper/Documents/Dev/code/pyon/eggs/gevent-0.13.7-py2.7-macosx-10.6-x86_64.egg/gevent/event.py", line 214, in get
result = get_hub().switch()
File "/Users/asadeveloper/Documents/Dev/code/pyon/eggs/gevent-0.13.7-py2.7-macosx-10.6-x86_64.egg/gevent/hub.py", line 164, in switch
return greenlet.switch(self)

Greenlet at 0x103b43190:
self:
func: bound, IonProcessThreadManager.target
traceback:
File "/Users/asadeveloper/Documents/Dev/code/pyon/eggs/gevent-0.13.7-py2.7-macosx-10.6-x86_64.egg/gevent/greenlet.py", line 390, in run
result = self._run(*self.args, **self.kwargs)
File "/Users/asadeveloper/Documents/Dev/code/pyon/pyon/core/thread.py", line 296, in target
self._shutdown_event.wait(timeout=self.heartbeat_secs)
File "/Users/asadeveloper/Documents/Dev/code/pyon/eggs/gevent-0.13.7-py2.7-macosx-10.6-x86_64.egg/gevent/event.py", line 255, in wait
result = get_hub().switch()
File "/Users/asadeveloper/Documents/Dev/code/pyon/eggs/gevent-0.13.7-py2.7-macosx-10.6-x86_64.egg/gevent/hub.py", line 164, in switch
return greenlet.switch(self)
```