[IPython-user] ask help for "Effective logging"
Fernando.Perez at colorado.edu
Wed Jan 18 00:49:32 CST 2006
> hello， I am a newbie of IPython.
> when i read the manual, Secton 4.2's label is Effective logging.
> It looks interesting, but I don't know how to use it in ipython.
> could anybody here give me a hand? thanks in advance.
The idea is to make an ipython 'profile' with the contents indicated in the
manual. IPython profiles are explained here:
So let's say that you want to make a profile called 'autolog' using Robert's
trick. You would then need to make a file named
which would contain:
logfile '' # cancel earlier logfile invocation
execute import time
execute __cmd = 'PUT_SOME_PATH_YOU_WANT_HERE-%s.log rotate'
execute __IP.magic_logstart(__cmd % time.strftime('%Y-%m-%d'))
Then, you'd simply call ipython using this profile as
ipython -p autolog
at the command line. If you end up using this very frequently, you can alias
it witha convenient name of your choosing.
I hope this helps.
More information about the IPython-user