From 716d280590639b8e0161ac52b907e56dfb99b16d 2005-12-29 19:48:33 From: fperez Date: 2005-12-29 19:48:33 Subject: [PATCH] doc fixes to logging --- diff --git a/IPython/Logger.py b/IPython/Logger.py index 4deb55f..d854425 100644 --- a/IPython/Logger.py +++ b/IPython/Logger.py @@ -2,7 +2,7 @@ """ Logger class for IPython's logging facilities. -$Id: Logger.py 966 2005-12-29 08:34:07Z fperez $ +$Id: Logger.py 974 2005-12-29 19:48:33Z fperez $ """ #***************************************************************************** @@ -160,11 +160,11 @@ which already exists. But you must first start the logging process with print 'Logging has not been activated.' else: state = self.log_active and 'active' or 'temporarily suspended' - print 'Filename :',self.logfname - print 'Mode :',self.logmode - print 'Output logging:',self.log_output - print 'Timestamping :',self.timestamp - print 'State :',state + print 'Filename :',self.logfname + print 'Mode :',self.logmode + print 'Output logging :',self.log_output + print 'Timestamping :',self.timestamp + print 'State :',state def log(self, line,continuation=None): """Write the line to a log and create input cache variables _i*.""" diff --git a/IPython/Magic.py b/IPython/Magic.py index 9b1d6c5..baada61 100644 --- a/IPython/Magic.py +++ b/IPython/Magic.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Magic functions for InteractiveShell. -$Id: Magic.py 973 2005-12-29 18:51:56Z fperez $""" +$Id: Magic.py 974 2005-12-29 19:48:33Z fperez $""" #***************************************************************************** # Copyright (C) 2001 Janko Hauser and @@ -931,9 +931,14 @@ Currently the magic system has the following functions:\n""" -o: log also IPython's output. In this mode, all commands which generate an Out[NN] prompt are recorded to the logfile, right after their corresponding input line. The output lines are always - prepended with a #[Out]# marker, so that the log remains valid + prepended with a '#[Out]# ' marker, so that the log remains valid Python code. + Since this marker is always the same, filtering only the output from + a log is very easy, using for example a simple awk call: + + awk -F'#\\[Out\\]# ' '{if($2) {print $2}}' ipython_log.py + -t: put timestamps before each input line logged (these are put in comments)."""