[IPython-dev] Logging output garbled

Dave Hirschfeld dave.hirschfeld at gmail.com
Wed May 29 06:47:52 EDT 2013


The following (expected) exception in my console:

In [26]: rc[2].get('x')
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<string> in <module>()
c:\dev\code\ipython\IPython\parallel\util.py in _pull(keys)
    243         return map(lambda key: eval(key, globals()), keys)
    244     else:
--> 245         return eval(keys, globals())
    246 
    247 @interactive
<string> in <module>()
NameError: name 'x' is not defined


...gets logged by the engine as follows:


C:\Users\dhirschfeld>ipengine
2013-05-29 11:38:22.798 [IPEngineApp] Using existing profile dir: 
u'C:\\Users\\dhirschfeld\\.ipython\\profile_default'
2013-05-29 11:38:22.802 [IPEngineApp] Loading url_file 
u'C:\\Users\\dhirschfeld\\.ipython\\profile_default\\security\\ipcontroller-
engine.json'
2013-05-29 11:38:22.819 [IPEngineApp] Registering with controller at 
tcp://127.0.0.1:54414
2013-05-29 11:38:22.977 [IPEngineApp] Starting to monitor the heartbeat 
signal from the hub every 3010 ms.
2013-05-29 11:38:22.983 [IPEngineApp] Using existing profile dir: 
u'C:\\Users\\dhirschfeld\\.ipython\\profile_default'
2013-05-29 11:38:22.989 [IPEngineApp] Completed registration with id 2
2013-05-29 11:38:34.990 [IPEngineApp] Exception in apply request:
←[1;31m---------------------------------------------------------------------
------←[0m
←[1;31mNameError←[0m                                 Traceback (most recent 
call last)
←[1;32m<string>←[0m in ←[0;36m<module>←[1;34m()←[0m

←[1;32mc:\dev\code\ipython\IPython\parallel\util.py←[0m in 
←[0;36m_pull←[1;34m(keys)←[0m
←[0;32m    243←[0m         ←[1;32mreturn←[0m 
←[0mmap←[0m←[1;33m(←[0m←[1;32mlambda←[0m ←[0mkey←[0m←[1;33m:←[0m 
←[0meval←[0m←[1;33m(←[0m←[0mkey←[0m←[1;33m,←[0m 
←[0mglobals←[0m←[1;33m(←[0m←[1;33m)←[0m←[1;33m)←[0m←[1;33m,←[0m 
←[0mkeys←[0m←[1;33m)←[0m←[1;33m←[0m←[0m
←[0;32m    244←[0m     ←[1;32melse←[0m←[1;33m:←[0m←[1;33m←[0m←[0m
←[1;32m--> 245←[1;33m         ←[1;32mreturn←[0m 
←[0meval←[0m←[1;33m(←[0m←[0mkeys←[0m←[1;33m,←[0m 
←[0mglobals←[0m←[1;33m(←[0m←[1;33m)←[0m←[1;33m)←[0m←[1;33m←[0m←[0m
←[0m←[0;32m    246←[0m ←[1;33m←[0m←[0m
←[0;32m    247←[0m ←[1;33m@←[0m←[0minteractive←[0m←[1;33m←[0m←[0m

←[1;32m<string>←[0m in ←[0;36m<module>←[1;34m()←[0m

←[1;31mNameError←[0m: name 'x' is not defined


I assume the mess are ansi escape codes? They do make it slightly hard to 
debug problems using the logs (which are very useful) so I'm wondering if 
there is a way to prevent this happening?

Thanks,
Dave





More information about the IPython-dev mailing list