views:

16

answers:

1

64-bit Vista, Python 2.6, IPython 0.10

I want to try logging everything I do, so I set

o.log = 1

in my ipy_user_conf.py .

But logging doesn't start. It will if I enter "logstart" at the prompt. But what's the problem with 'o.log = 1'?

+1  A: 

Where does your ipy_user_conf.py reside? If you are editing the Python26\Lib\site-packages\IPython\UserConfig file, chances are it doesn't even get loaded in the first place.

The right file is in %USERPROFILE%\_ipython, editing that should do the trick.

Also, I'd suggest using

o.autoexec.append('%logstart <option>')

that way, you can configure logging using the regular magic command.

Jim Brissom
The installation of IPython created c:\users\Dick\_ipthon\ with the config files in it, including ipy_user_conf.py. It does get loaded, because some of the changes I made take effect when I start IPython. Such as 'import mpmath' (no quotes), a line I stuck into main().
NotSuper
Yep, that one is basically the one in your user profile. What happens when you autoexec %logstart?
Jim Brissom
That line you suggested produced this 572 line crash report: http://www.rcblue.com/Misc/IPython_crash_report.txt
NotSuper
You were not supposed to paste that one in literally, but to supply your own options to logstart, as in `o.autoexec.append('%logstart mylogfile.log rotate')`
Jim Brissom
Sorry. I have rotate there now, and logging is working. I think I saw that it was possible to get a timestamp for the entries. Can you tell me how to do that? Thanks for your help.
NotSuper

related questions