Skip to content
This repository

Issue https://github.com/ipython/ipython/issues/832 resolution #834

Merged
merged 1 commit into from over 2 years ago

3 participants

bernardpaulus Thomas Kluyver Bernardo B. Marques
bernardpaulus

I fixed the small issue with %logstop #832

Thanks to takluyver for it's time & patience! That was my first 'git push'

bernard

Thomas Kluyver takluyver merged commit fcafc40 into from October 02, 2011
Thomas Kluyver takluyver closed this October 02, 2011
Thomas Kluyver
Collaborator

Tested and merged. Thanks, Bernard! Feel free to keep on contributing.

Bernardo B. Marques

i'm sorry, but I think that "Logging hasn't beend started" is better, isn't it ?

Collaborator

I think either works. This version means "logging hadn't been started when you asked to stop it".

but, in the same code there is this message "Logging hasn't been started yet...", I think this way is better, and you should keep a standard. How can i get in touch with you, to talk about some "clean code" issues ?

Collaborator

You're quite right, there is.

Either send an email to the list (ipython-dev@scipy.org), or just make a pull request with the changes you want. In fact, you could include this wording change with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 03, 2011
bernardpaulus Issue ipython/ipython#832 resolution fcafc40
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  IPython/core/logger.py
7  IPython/core/logger.py
@@ -206,8 +206,11 @@ def logstop(self):
206 206
         made, possibly (though not necessarily) with a new filename, mode and
207 207
         other options."""
208 208
         
209  
-        self.logfile.close()
210  
-        self.logfile = None
  209
+        if self.logfile is not None:
  210
+            self.logfile.close()
  211
+            self.logfile = None
  212
+        else:
  213
+            print "Logging hadn't been started."
211 214
         self.log_active = False
212 215
 
213 216
     # For backwards compatibility, in case anyone was using this.
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.