Search code examples
loggingconfiguration-filesipythonvista64

How to configure ipy_user_conf.py to get IPython to start logging right away?


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'?


Solution

  • 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.