4

I'm using iPython 0.12 and setting up my config file. Turning on logging from the get-go was no problem, just setting

c.TerminalInteractiveShell.logstart = True in ~/.ipython/profile_default/ipython_config.py.

However, I also would like to have timestamps in my logfile, the same way %logstart -t would do.

Is there any way to set this in the config file?

rodrigoap
  • 7,405
  • 35
  • 46
Juan
  • 5,433
  • 21
  • 23

1 Answers1

-1

All commands are now logged to an SQLite database, and IPython has an API to access data from that, if that meets your needs.

If you want text logs, you can modify the cookbook example for dated log files here: http://wiki.ipython.org/Cookbook/DatedLog

Thomas K
  • 39,200
  • 7
  • 84
  • 86
  • 1
    If this answers the original question, it isn't clear to me. I have the same question. – MountainX May 31 '12 at 20:28
  • Nope, it doesn't, even though it _is_ handy. I was looking for a timestamp for each command. Potentially accessing the SQLite API would do, but I haven't looked into how to use that to stamp the text files. – Juan Jun 01 '12 at 15:58
  • 1
    If you use a startup file, rather than config, you can call logstart with the `-t` flag for timestamps as IPython starts. The example shows the `-o` flag in use. – Thomas K Jun 06 '12 at 11:52