Here is what I have in my ipy_user_conf.py file:<br><br><br>def main(): <br><br> try:<br> ldir = '/home/user/.ipython/'<br> filename = os.path.join(ldir, strftime('%Y-%m-%d')+".py")<br>
notnew = os.path.exists(filename)<br> ip.IP.logger.logstart(logfname=filename, logmode='append')<br> if notnew:<br> ip.IP.logger.log_write("# =================================")<br>
else:<br> ip.IP.logger.log_write("""#!/usr/bin/env python \n# %s.py \n# IPython automatic logging file""" % strftime('%Y-%m-%d'))<br> ip.IP.logger.log_write("""# %s \n# =================================""" % strftime('%H:%M'))<br>
print " Logging to "+filename<br><br> except RuntimeError:<br> print " Already logging to "+ip.IP.logger.logfname<br><br><br>I learnt this trick from Pierre Raybaut of PythonXY. There is a log file per day and time-stamping per session. I am sure it could easily modified to log everything in a file and with a time stamp if this is what you need.<br>
<br><div class="gmail_quote">
On Tue, Jan 12, 2010 at 9:12 AM, gaubi <span dir="ltr"><<a href="mailto:erwin.gaubitzer@univie.ac.at" target="_blank">erwin.gaubitzer@univie.ac.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
In order to retrace my work I want to always have timestamping on.<br>
Is this possible using a commandline parameter or in a configuration file?<br>
<br>
Thanks<br>
Erwin<br>
<font color="#888888">--<br>
View this message in context: <a href="http://old.nabble.com/Log-options-at-ipython-startup-tp27129034p27129034.html" target="_blank">http://old.nabble.com/Log-options-at-ipython-startup-tp27129034p27129034.html</a><br>
Sent from the IPython - User mailing list archive at Nabble.com.<br>
<br>
_______________________________________________<br>
IPython-user mailing list<br>
<a href="mailto:IPython-user@scipy.org" target="_blank">IPython-user@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-user" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-user</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Gökhan<br>